Bilal Khan

Bilal Khan

  • 1.5k
  • 108
  • 418

How to strone login user session id in database table?

Jul 21 2020 12:07 AM
protected void TextBox2_Click(object sender, EventArgs e)
{
using (SuperFastEntities db = new SuperFastEntities())
{
sample u = new sample();
u.name = sname.Text;
string id = Session["username"].ToString().Trim();
u.userID =Convert.ToInt32(id);
db.samples.Add(u);
db.SaveChanges();
}
 
Here is my code but not successfull. can somone help please!! 

Answers (1)