Total Pageviews

Wednesday, December 8, 2010

.NET Framework Versions and Dependencies


Each version of the .NET Framework contains the common language runtime (CLR) as its core component, and includes additional components such as the base class libraries and other managed libraries. This topic describes the key components of the .NET Framework versions, provides information about the underlying CLR versions and associated development environments, and identifies the versions that are installed by Windows.
The following illustration summarizes the version history and which versions are installed by Windows.

Tuesday, December 7, 2010

How to download an .swf file?

This is for Mozilla Firefox:-

1.Find the ADD-ON from tools named-CacheViewer.
2.Now open the webpage having as .swf file and search for that file in the cache viewer.
3.Download the file from there at specified folder.

Hope you will find if helpful.
Thanks.

With regards,
Er. Prachi Bhatnagar.

Thursday, December 2, 2010

How to 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");
}
}

}