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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 7, 2013, 7:58 PM EDT
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.
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 7, 2013, 8:12 PM EDT
You can do like this
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 7, 2013, 8:16 PM EDT
Tan Kai Kai114 reputationPosted Jul 8, 2013, 4:06 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 8, 2013, 4:10 AM EDT
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 8, 2013, 4:15 AM EDT
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'
Tan Kai Kai114 reputationPosted Jul 8, 2013, 4:20 AM EDT
"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?
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 8, 2013, 4:25 AM EDT
Regards,
Iftikar
Tan Kai Kai114 reputationPosted Jul 8, 2013, 4:30 AM EDT
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 HussainRank #423 · 5.9K reputationPosted Jul 8, 2013, 4:38 AM EDT
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 8, 2013, 4:42 AM EDT
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"]);
Tan Kai Kai114 reputationPosted Jul 8, 2013, 4:45 AM EDT
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
Tan Kai Kai114 reputationPosted Jul 8, 2013, 4:46 AM EDT
how can this be done after they have log in?