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
varsha dodiya
NA
407
75.2k
insert data in sql table in C#
Jul 10 2014 2:13 AM
when i insert data it throws exception "erroe converting datatype nvarchar to numeric" plz help me in fixing this.
private void btnSave2_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("insert into PRO_BILL (S_name,P_billno,P_ch_no,P_pur_date,P_btotal,P_tovat,P_dis,P_gt,P_paid) values (@S_name,@P_billno,@P_ch_no,@P_pur_date,@P_btotal,@P_tovat,@P_dis,@P_gt,'n')", conn);
conn.Open();
cmd.Parameters.AddWithValue("@S_name", tbSupname.Text);
cmd.Parameters.AddWithValue("@P_billno", tbBILLNO.Text);
cmd.Parameters.AddWithValue("@P_ch_no", tbCHLNno.Text);
cmd.Parameters.AddWithValue("@P_pur_date", Convert.ToDateTime(dateTimePicker1.Text));
cmd.Parameters.AddWithValue("@P_btotal", tbtot1.Text);
cmd.Parameters.AddWithValue("@P_tovat", tbVAT.Text);
cmd.Parameters.AddWithValue("@P_dis", tbDisTOT.Text);
cmd.Parameters.AddWithValue("@P_gt", tbGT.Text);
cmd.ExecuteNonQuery();
conn.Close();
}
Reply
Answers (
21
)
Sorting ascending of anonymous list created from ToArray()?
alphanumeric value like FPS1000 is assigning to a variable