Friday, February 19, 2010

Microsoft .NET Framework 4.0


Microsoft .NET Framework


The Microsoft .NET Framework is a software framework that can be installed on computers running Microsoft Windows operating systems. It includes a large library of coded solutions to common programming problems and a virtual machine that manages the execution of programs written specifically for the framework. The .NET Framework is a Microsoft offering and is intended to be used by most new applications created for the Windows platform.


In this articles we talk about Microsoft .NET Framework 4.0


What’s new in .NET Framework 4.0?


1. Next versions of Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) will provide better support for Web 2.0 technologies like REST, POX, and ATOM.


2. Performance and Scalability of WCF and WF are expected to increase by minimum 10X.


3. New workflow models.


4. Seamless integration between WCF and WF including a new Visual Designer.


5. Parallel Programming framework using PLINQ, Task Parallel Library and Coordination Data Structures to better utilize power of multi-processor and multi-core machines.


6. Build declarative applications with WF, WCF and WPF using XAML. So, XAML is no more only for WPF and WF.


7. WCF enhancements:


1. RESTful enhancements


1. Simplifying the building of REST Singleton & Collection Services, ATOM Feed and Publishing Protocol Services, and HTTP Plain XML Services using WCF


2. WCF REST Starter Kit to be released on Codeplex to get early feedback


2. Messaging enhancements


1. Transports - UDP, MQ, Local in-process


2. Protocols - SOAP over UDP, WS-Discovery, WS-Business Activity, WS-I BP 1.2


3. Duplex durable messaging


3. Correlation enhancements


1. Content and context driven, One-way support


4. Declarative Workflow Services


1. Seamless integration between WF and WCF and unified XAML model


2. Build entire application in XAML, from presentation to data to services to workflow


8. WF enhancements:


1. Significant improvements in performance and scalability


1. Ten-fold improvement in performance


2. New workflow flow-control models and pre-built activities


1. Flowcharts, rules


2. Expanded built-in activities – Power Shell, database, messaging, etc.


3. Enhancements in workflow modeling


1. Persistence control, transaction flow, compensation support, data binding and scoping


2. Rules composable and seamlessly integrated with workflow engine


4. Updated visual designer


1. Easier to use by end-users


2. Easier to rehost by ISVs


3. Ability to debug XAML


 


Regard


Prateek Bhatnagar


Wednesday, February 3, 2010

Upload Image in Database and Display Image

upload images.. first i created a database table with the following columns...

Id --> int (identity column, and primary key)

firstname -->varchar(50)

lastname -->varchar(50)

image -->varchar(50)

and under my web site root directory i have created a folder with name..(images)

here is the code.. to upload the image....



using System.IO;
using System.Data.SqlClient;
using System.Web.Configuration;

protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileExt = Path.GetExtension(FileUpload1.FileName).ToLower();
string fileName = Path.GetFileName(FileUpload1.FileName);
string dbfilePath = @"~/images/" + fileName;
if (fileName != string.Empty)
{
try
{
if (fileExt == ".jpg" || fileExt == ".gif")
{
FileUpload1.SaveAs(Server.MapPath(@"~/images/") + fileName);
}
else
{
Response.Write("You can upload only JPG or GIF files...");
}
}
catch (Exception ex)
{
throw ex;
}
}
SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["myConnection"].ConnectionString);
SqlCommand cmd = new SqlCommand("insert into images values(@firstname,@lastname,@image)",con);
cmd.Parameters.AddWithValue("@firstname",TextBox1.Text);
cmd.Parameters.AddWithValue("@lastname",TextBox2.Text);
cmd.Parameters.AddWithValue("@image",dbfilePath);
con.Open();
int i = cmd.ExecuteNonQuery();
con.Close();
if (i > 0)
{
Response.Write("Uploaded");
}
}

}


Display Image in Repeater

his is how you can display the images in Repeater control....

Html...









CodeBehind...
using System.Data.SqlClient;
using System.Web.Configuration;

protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["myConnection"].ConnectionString);
SqlCommand cmd = new SqlCommand("select * from images",con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
Repeater1.DataSource = dt;
Repeater1.DataBind();
}

Regard
Prateek

Install Silver Light

Hi,

Mostly many person not know how to install silverlight so,follow this steps:
1 Microsoft visual studio 2008 (SP1)
2 Silverlight tool.exe
3 Microsoft Expression Blend 2.0
4 Microsoft Expression Blend 2.0 (SP1)
5 Silverlight tool kit 2 March

Regard
Prateek