Why null value is inserted in the table Post(Post_P varchar(255),Post_E varchar(255)) ?
MySqlConnection c;
c = new MySqlConnection("Database=dbase;Data Source=localhost;User Id=root;Password=rootpass");
c.Open();
MySqlCommand com = new MySqlCommand("select Post_p,Post_E from Post", c);
MySql.Data.MySqlClient.MySqlDataAdapter PostAdapter = new MySqlDataAdapter(com);
PostAdapter.InsertCommand = new MySqlCommand("INSERT INTO Post(Post_P,Post_E) VALUES (@Post_P, @Post_E);", c);
MySqlParameter p0 = PostAdapter.InsertCommand.Parameters.Add("@Post_P", MySql.Data.MySqlClient.MySqlDbType.VarChar, 255, "Post_P");
MySqlParameter p1 = PostAdapter.InsertCommand.Parameters.Add("@Post_E", MySql.Data.MySqlClient.MySqlDbType.VarChar, 255,"Post_E");
PostAdapter.Fill(ConfigureDataSet, "Post");
DataRow d=null;
d= ConfigureDataSet.Tables["Post"].NewRow();
d[0] = "T11";
d[1] = "T11";
ConfigureDataSet.Tables["Post"].Rows.Add(d);
PostAdapter.Update(ConfigureDataSet.Tables["Post"]);
c.Close();
Enter your message below
Sign in or Join us (it's free).