1
Answer

How to strone login user session id in database table?

Photo of Bilal Khan

Bilal Khan

4y
536
1
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)