AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 System.Data.SqlClient.SqlException: SQL Server Internal Error. Text manager cannot continue with current statement.
Posted by charan on  5/15/2010 3:23:21 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Safa"].ConnectionString); string branchid = ""; protected void Page_Load(object sender, EventArgs e) { branchid= Session["branchid"].ToString(); if (IsPostBack == false) { Image1.ImageUrl = "left1.ashx?BranchId=" + branchid; Image2.ImageUrl = "left1old.ashx?BranchId=" + branchid; } protected void Button1_Click(object sender, EventArgs e) {// update code SqlCommand cmdupdate = new SqlCommand("left1update", con); cmdupdate.CommandType = CommandType.StoredProcedure; con.Open(); cmdupdate.Parameters.AddWithValue("@BranchId", branchid); if ( FileUpload1.HasFile) { FileInfo left1info = new FileInfo( FileUpload1.PostedFile.FileName.Trim()); byte[] left1content = new byte[left1info.Length]; FileStream left1stream = left1info.OpenRead(); left1stream.Read(left1content, 0, left1content.Length); left1stream.Close(); cmdupdate.Parameters.AddWithValue("@imgleft1",left1content); } cmdupdate.Parameters.AddWithValue("@notel1",txtnotes.Text); if(cmdupdate.ExecuteNonQuery()!=0) { Functions.ShowAlertMessage("Updated....."); txtnotes.Text = ""; System.Threading.Thread.Sleep(2000); Image1.ImageUrl = "left1.ashx?BranchId=" + Session["branchid"].ToString(); Image2.ImageUrl = "left1old.ashx?BranchId=" + Session["branchid"].ToString(); }


procedure iam using

create procedure left1update(@BranchId nvarchar(50),@imgleft1 image, @notel1 nvarchar(200))
as
update tblImages set imgleft1old= CONVERT( image,imgleft1)
,imgleft1=@imgleft1 ,notel1=@notel1 where (BranchId=@BranchId)


GO

when iam clicking the button my current image should store in imgleft1old field and the newly browse one should store in imgleft1 field

but it giving error
System.Data.SqlClient.SqlException: SQL Server Internal Error. Text manager cannot continue with current statement.



can you correct my code which helps me




Post Your Reply Post New Question

 Viewer's Reply
Using UPDATETEXT to update Image Column
Answered By Moderator1 on 5/17/2010 7:57:17 AM
Hi,

I think you are trying to update an Image column in the tblImages table. Try to use UpdateText or WriteText SQL functions. For reference, use the below url,

http://msdn.microsoft.com/en-us/library/ms189466.aspx
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Introduction to Software Development
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
Everything You Know About CSS Is Wrong! - Free 37 Page Preview!