Previous Thread:   not sure if i did this correctly...

9/30/2005 2:48:40 PM    How To? Bind MS Access to DropDownList?
I am sure this must be about the simplest thing to do.  I can whip  
  
something off in 10 different languages and environments with no  
  
problem.  But VisualStudio 2003 and ASP.NET is sooooo frustrating!!!  
  
My example is simple.  I have an Access table (mytable) with two fields  
  
of type text (userid and password).  
  
I want to display a dropdownlist on a page and have it list the  
  
userids.  Nothing more.  
  
Since VisualStudio is a little more graphical than, say, notepad, I  
  
want to take advantage of drag and drop programming.  
  
I create my database connection in the server panel.  
  
I add an OleDbConnection, OleDbDataAdapter and DataSet (not sure if  
  
this is right but it seemed like I was being lead in that direction).  
  
Next I drop a dropdownlist on the form.  Goto properties and set  
  
DataSource = DataSet11  
  
DataMember = mytable  
  
DataTextField = userid  
  
DataValueField = userid  
  
Build and view and I get a nice white page with an empty dropdown list  
  
sitting on it.  Tried addind DataBind() to the page_load and still  
  
nothing.  
  
Tried searching help/gotdotnet/msdn/etc and find plenty of examples on  
  
databinding to arraylists and other datasource types but nothing that  
  
helps me out.  Some examples I didn't try but they involved 20-30 lines  
  
of code.  Surely it doesn't take that much code now, in a drag and drop  
  
IDE, to do what we could do in ASP.Classic and notepad in 4 lines?  
  
Please help, or better yet point me to a resource that so far has  
  
eluded by many Google attempts?  
  
Thanks,  
  
T



9/30/2005 3:17:45 PM    Re: How To? Bind MS Access to DropDownList?
add db connection  
  
add data adapter  
  
create dataset from data adapter  
  
set dataset as datasource, and set datatextfield and datavaluefield  
  
switch to Page_Load event handler  
  
call dataadapter.Fill(dataset)  
  
call dropdownlist.DataBind()  
  
cheers  
  
troy.forster@gmail.com wrote:

9/30/2005 8:44:38 PM    Re: How To? Bind MS Access to DropDownList?
<<I can whip something off in 10 different languages and environments with  
  
no problem>>  
  
You must be amazing! I didn't know there were 10 different languages AND  
  
environments. What are they? Apparently NONE of them are .NET languages or  
  
Visual Studio because that's where you're having trouble. Can you just  
  
provide a simple list of what they are? All 10 of them? Or even 5 of them.  
  
That would be great to know.  
  
(really curious here!)  
  
Thanks!  
  
-F  
  
<troy.forster@gmail.com> wrote in message  
  
news:1128116920.066309.198950@g44g2000cwa.googlegroups.com...

10/1/2005 8:51:21 AM    Re: How To? Bind MS Access to DropDownList?
LOL  
  
"Frankie" <BeansAndTacos@TacoTime.net> wrote in message  
  
news:uZafypjxFHA.2132@TK2MSFTNGP15.phx.gbl...