how to insert varbinary dat into sqlserverce
I have develop a small asp.net application to store the data into sqlserverce ,How can i set varbinary(max) in sqlserver ce.i have wrote the code like this
string filepath = Server.MapPath("~/App_Data/") + txtuname.Text + ".sdf";
SqlCeConnection conn = new SqlCeConnection(@"Data Source=" + filepath);
conn.Open();
SqlCeCommand cmdCreate = new SqlCeCommand("CREATE TABLE Mybusinessapp_Pictures (Id int IDENTITY(1,1)PRIMARY KEY, Name nchar(50),Description nvarchar(500),Data varbina开发者_如何转开发ry(510),ImageUrl nvarchar(500))", conn);
cmdCreate.ExecuteNonQuery();
MessageBox.Show("Table created:");
When I try to insert data into this it showing error like
The conversion is not supported. [ Type to convert from (if known) = nvarchar, Type to convert to (if known) = varbinary ]
What is was the wrong please help me...
Use the image data type, varbinary(MAX) is not suported by SQL Server Compact
精彩评论