Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
11
Reply
insert a converted date into database
Mehboob Ali
Feb 27 2016 10:19 PM
409
Reply
My System date format is customized as dd/MM/yyyy
when i enter date e.g 25/02/2016 than in textbox c# windows form, it gives error System.Data.SqlClient.SqlException
My Code is given below
private void button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Test;User ID=abc; Password=****");
SqlDataAdapter sda = new SqlDataAdapter("insert into dates values('"+textBox1.Text.ToString()+"')",con);
DataTable dt = new DataTable();
sda.Fill(dt);
MessageBox.Show("Data Inserted");
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
11
)
Next Recommended Forum
Show select ed value in drop down list
Shuffle / random a list of objects and get the same result