How can I call an ID of the user form database
for e.g
ID USERNAME
1Tests
2Testss
I want to get the id and undate the database?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tan Kai KaiPosted Jul 8, 2013, 8:46 AM
how can this be done after they have log in?
Tan Kai KaiPosted Jul 8, 2013, 8:45 AM
they can go on to the next tab. If not they cloud go on the the next tab (this can be work) and they will fill up some thing and will update on the same row that is where the error come as I cloud not get the id of the row
as they have insert to the table for the first tab
Sanjeeb LenkaPosted Jul 8, 2013, 8:42 AM
better to use session.
ex-
Session["ID"]=ID;
now you can able to access it in every page.
ex-
int CustomerID = Convert.ToInt32(Session["ID"]);
Iftikar HussainPosted Jul 8, 2013, 8:38 AM
Regards,
Iftikar
Tan Kai KaiPosted Jul 8, 2013, 8:30 AM
because my page got a tab and want user click next after they fill the name email and so on
they will come to a tab on the same page that as that to fill the address and so on and will update the table from there
Iftikar HussainPosted Jul 8, 2013, 8:25 AM
Regards,
Iftikar
Tan Kai KaiPosted Jul 8, 2013, 8:20 AM
"Update [Table name] SET [FirstName] = @FristName WHERE CUSTOMER ID=@CustomerID";
Cmd.Parameters.AddWithValue ("@CustomerID", Customer_ID());
Cmd.Parameters.AddWithValue ("@FirstName", txtFirstName.Text);
public in Customer_ID()
{
intCustomerID =0;
CustomerID = int.Parse(Request.QueryString["id"]);
return Customer;
}
I have error in the the red colour word say null that this is string
How can I slove this?
Sanjeeb LenkaPosted Jul 8, 2013, 8:15 AM
select ID,Username from TableName where Username='username you want to match'
or
select ID,Usernam from TableName where ID='pass the ID you want to match'
Iftikar HussainPosted Jul 8, 2013, 8:10 AM
Regards,
Iftikar
Tan Kai KaiPosted Jul 8, 2013, 8:06 AM
Sanjeeb LenkaPosted Jul 8, 2013, 12:16 AM
Iftikar HussainPosted Jul 8, 2013, 12:12 AM
You can do like this
Regards,
Iftikar
Jignesh TrivediPosted Jul 7, 2013, 11:58 PM
you mean to say, you want Id from username right?
if yes than you can write following query..
select Id from Users where Username = 'test'
if you look other than this please provide more information.