send string to sql problem
-
Hi, i have a few textbox in my asp.net form. I have to add strings and save it as 1 string to the nvarchar typed column of my sql table. Here is the result of string: "1,-,3,4,-,-,-,-," When i try to insert this string to my column it gives this error: System.Data.SqlClient.SqlException: String or binary data would be truncated. The statement has been terminated. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at serviceReport.newReport.Insert_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\serviceReport\newReport.aspx.vb:line 245 Does someone knows how to send this string? In string if textBox is free i use "-" , if you know another way i can use it too.. thanx in advance.. --junior coder--
-
Hi, i have a few textbox in my asp.net form. I have to add strings and save it as 1 string to the nvarchar typed column of my sql table. Here is the result of string: "1,-,3,4,-,-,-,-," When i try to insert this string to my column it gives this error: System.Data.SqlClient.SqlException: String or binary data would be truncated. The statement has been terminated. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at serviceReport.newReport.Insert_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\serviceReport\newReport.aspx.vb:line 245 Does someone knows how to send this string? In string if textBox is free i use "-" , if you know another way i can use it too.. thanx in advance.. --junior coder--
The error message normally indicates that the column where you are intending to save this value is of size which is less than the length of the string that you are passing. Deepak Kumar Vasudevan Personal Web: http://vdeepakkumar.netfirms.com/ I Blog At: http://deepak.blogdrive.com/
-
The error message normally indicates that the column where you are intending to save this value is of size which is less than the length of the string that you are passing. Deepak Kumar Vasudevan Personal Web: http://vdeepakkumar.netfirms.com/ I Blog At: http://deepak.blogdrive.com/
no it is impossible cause i send a string like: "1,-,3,-,4,5,6,7,8,9,10" it's length can be 25 maximum and in sql column type is nvarchar and mazlength is 4000. there ' s something wrong with my string? --junior coder--
-
no it is impossible cause i send a string like: "1,-,3,-,4,5,6,7,8,9,10" it's length can be 25 maximum and in sql column type is nvarchar and mazlength is 4000. there ' s something wrong with my string? --junior coder--
Hi: Can you check out the String that is being sent as CommandText to to the ExecuteNonQuery? You can check that out in a Watch. I think a column is being mismatched. Deepak Kumar Vasudevan Personal Web: http://vdeepakkumar.netfirms.com/ I Blog At: http://deepak.blogdrive.com/
-
Hi: Can you check out the String that is being sent as CommandText to to the ExecuteNonQuery? You can check that out in a Watch. I think a column is being mismatched. Deepak Kumar Vasudevan Personal Web: http://vdeepakkumar.netfirms.com/ I Blog At: http://deepak.blogdrive.com/
no problem with command.because it works if i do not use the "-" for the empty textBoxes. But i need all textBox.Text values like an array. Is there another way? i wrote the total string in a textBox and here it is: -,2,-,4,5,-,7,-,9,-, So if this problem is hard to solve ,i may change my way to collect the text value of my textBoxes . Do you know another way to collect the text in one string to convert an array in future codes.i can not insert this string to nvarchar(4000) typed column heeeelp:(( --junior coder--
-
no problem with command.because it works if i do not use the "-" for the empty textBoxes. But i need all textBox.Text values like an array. Is there another way? i wrote the total string in a textBox and here it is: -,2,-,4,5,-,7,-,9,-, So if this problem is hard to solve ,i may change my way to collect the text value of my textBoxes . Do you know another way to collect the text in one string to convert an array in future codes.i can not insert this string to nvarchar(4000) typed column heeeelp:(( --junior coder--
i solved my problem:-D i am really silly! i had changed the type of a column int to nvarchar vut it's length was 10 thanx for your help have i said i am silly:) --junior coder--