Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

asp.net populate dropdown problem

New Here ,
Apr 01, 2009 Apr 01, 2009
Hello,

I am having difficulty in trying to populate a dropdown, I can do this fine untill i add WHERE to the statement.

I have created a page where the user logs in and the username is then displayed in a text field called 'user' - i want the sql statement to do this:

SELECT regnumber
FROM regdetails
WHERE username = user

If i substitute the user for the actual user for eg
WHERE username = 'Peter'
then it works fine

i have tried using Dreamweaver dataset complier but can not get it to work. (also its in C#)

Hope somebody can help or advise

many thanks

Lance
TOPICS
Server side applications
316
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 06, 2009 Apr 06, 2009
LATEST

Lance,

  Can you provide me with the page error?  Also some of your C# code, I might be able to help. How are you binding the dropdown box or textbox?

If you are using a sqldatasource control you can binding the textbox with the username:
<asp:TextBox ID="user" runat="server"   Text='<%# Bind("username") %>' />

David Pearson

www.saludalabs.com

www.workhorsecreative.net

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines