SIGN UP MEMBER LOGIN:    

manikantan p

Member since Feb 19, 2010 India
Total Visits: 14
Read Count: 00 Liked: 0
manikantan p's Image

Prerequisites * Knowledge in Using MS SQL Server Stored Procedure * Knowledge in C#.NET Windows Application * Knowledge in ADO.NET Introduction How to Store or Save Image in MS SQL Server table This article talks about using Images data type in MS SQL Server and also provides sample code to store images in MS SQL Server database. To store an image in to sql server, you need to read image file into a byte array. Once you have image data in byte array, you can easity store this image data in sql server using sql parameters. Following code explains you how to convert the image data into byte array using byte img = Convert.Tobyte(img); . Using the code A brief description of how to use the article or code. The class names, the methods and properties, any tricks or tips. Blocks of code should be set as style "Formatted" like this: Collapse using System.Data; using System.Data.Sql using System.Data.SqlClient; using System.Web; using System.Web.Services; public class FileUploader: System.Web.Services.WebService { ""MsoNormal""> SqlConnection myConnection = new SqlConnection("Data Source=server name ;Initial Catalog=database name; User ID=username; Password='password';"); SqlCommand myCommand = new SqlCommand(); string queryString = ""; public string UploadFile(byte[] f, string fileName) { // the byte array argument contains the content of the file // the string argument contains the name and extension // of the file passed in the byte array string nm = data[0]; string sn =data[1]; string bn =data[2]; string st = data[3]; byte img = Convert.Tobyte(img); myConnection.Open(); queryString = "INSERT INTO tablename(Name,SchemeName,BeneficiarName,Status,Photo)" + "VALUES('" + nm + "','" + sn + "','"+ bn +"','" + st + "',@img,'")"; myCommand.Parameters.AddWithValu
No all activity at the moment
No my activity at the moment
No friends activity at the moment
Member Popularity
MY FRIENDS
No friends at the moment
Community Activity
MY PHOTO
No photo's at the moment
Top Ranked
MY FOLLOWERS
No follower at the moment
I'M FOLLOWING
No following at the moment