TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
edu de souza
NA
65
0
Simple insert problem, C# + SQL
Aug 12 2008 6:48 PM
Hi guys, I need a quick help. I´m trying to insert a int value but, comething went wrong ... I´m receiving this message:
System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value '@id_categoria' to data type int.
Code goes above:
<script runat="server">
//insert
void Insert_Click(Object Src, EventArgs E)
{
SqlDataSource1.InsertParameters["id_categoria"].DefaultValue = id_categoria.Text.ToString();
SqlDataSource1.InsertParameters["acessorio"].DefaultValue = acessorio.Text.ToString();
SqlDataSource1.InsertParameters["codigo"].DefaultValue = codigo.Text.ToString();
SqlDataSource1.InsertParameters["tamanho"].DefaultValue = tamanho.Text.ToString();
SqlDataSource1.InsertParameters["texto"].DefaultValue = texto.Text.ToString();
SqlDataSource1.Insert();
Response.Redirect("insert_ok.aspx");
}
</script>
Many thanks.
Reply
Answers (
4
)
Hiding a column in a ListView
combobox with multiple columns