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
Eduard Szigeti
NA
6
642
Table not updating
Jan 28 2021 3:23 PM
I have this code that I try to fill a table in a databse.
I push the ok button, I receive no error but nothing is in my table.
can anyone tell me what could be wrong?
Thanks
private void button1_Click(object sender, EventArgs e)
{
string conection = @" Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename = C:\Edy\Visual Studio\Last planner system\Last planner system\planning data.mdf";
using (SqlConnection con = new SqlConnection(conection))
con.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO (Project name) values (Name, Starting date, End date, Description ");
cmd.Parameters.Add("Name", SqlDbType.NVarChar).Value = txtName.Text;
cmd.Parameters.Add("Starting date ", SqlDbType.Date).Value = txtStartDate.Text;
cmd.Parameters.Add("End date", SqlDbType.Date).Value = TxtEndDate.Text;
cmd.Parameters.Add("Description", SqlDbType.Text).Value = txtDescription.Text;
using (SqlConnection con1 = new SqlConnection(conection))
con1.Close();
MessageBox.Show("Done!!!");
Reply
Answers (
8
)
Get the Average Score and display
Passing value from MVC View to Controller using ajax