V
Vaibhav
Hello,
I tried to insert a row in database table but its getting
inserted as the first row in the table. My second question is if i try to add
another record after first it gives me primary key violation
Here is the code below for ADD butoon :
protected void btnAdd_Click(object sender, EventArgs e)
{
try
{
Domain_List insertDom = new Domain_List { DomainName =
domainName.Text, DomainManagerID = managerID.Text };
db.Domain_Lists.InsertOnSubmit(insertDom);
db.SubmitChanges();
}
catch(Exception ex)
{
lblMsg.Text = ex.Message;
}
}
I tried to insert a row in database table but its getting
inserted as the first row in the table. My second question is if i try to add
another record after first it gives me primary key violation
Here is the code below for ADD butoon :
protected void btnAdd_Click(object sender, EventArgs e)
{
try
{
Domain_List insertDom = new Domain_List { DomainName =
domainName.Text, DomainManagerID = managerID.Text };
db.Domain_Lists.InsertOnSubmit(insertDom);
db.SubmitChanges();
}
catch(Exception ex)
{
lblMsg.Text = ex.Message;
}
}