this is my code. i am inserting the value in database.but topic column is always empty userby and date is inserted properly. tell me what i have to do so that all the values can be inserted.
try
{cn.Open();
string sql1 = "insert into Topics(Topic,UserBy,Date)values('" + TextBoxScrap.Text + "','" + Session["uname"].ToString() + "','" + DateTime.Now.ToString() + "')";
SqlCommand cmd = new SqlCommand(sql1, cn);
cmd.ExecuteNonQuery();
cn.Close();
TextBoxScrap.Text = "";
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}

Hajinder Jassal19 reputationPosted Nov 5, 2015, 8:13 PM EST
Hajinder Jassal19 reputationPosted Nov 5, 2015, 9:19 PM EST
Rupali ShindeRank #539 · 4.5K reputationPosted Nov 5, 2015, 10:41 PM EST
Praveen DhatrikaRank #3,145 · 455 reputationPosted Nov 5, 2015, 9:30 AM EST
Rupali ShindeRank #539 · 4.5K reputationPosted Nov 5, 2015, 6:55 PM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Nov 5, 2015, 8:33 PM EST