form and having some difficulties. I'm completely open for
suggestions. I'm using VS.net 2003, and what iwould like to accomplish
is to have a form with two dropdown Boxes a button and a datagrid to
display what was selected from the drop downs. One of the drop downs
values can not be used more than once while the others can be repeated
as often as they like. Being that I'm a somewhat new developer I'm
finding even the easiest tasks to be difficult. The DropDownBoxes are
server controls that I pre-populated from in the aspx html. These
values will change very infrequently, so editing the aspx to add more
shouldn't be a problem. The problem that I'm having is that I can not
get any values to show in the Data Grid. These values must also be
stored in a DB that I created. I'm confused on what Data Controls I
would need, how to configure them. I have a SQLConnection control and
it is, to my belief able to connect to the DB. I have also read to
have a SQLCommand control and a SQLDataAdapter control. Any assistance
is greatly appreciated. Thanks, WillTry this.
Dim myConn as SqlConnection = New SqlConnection(Connection string)
Dim myDa as SqlDataAdapter = new SqlDataAdapter("Select query", myConn)
myConn.Open()
Dim myDs as DataSet = New DataSet
myDa.Fill(Ds, "All") '{populate Dataset with data
'Bind data to datagrid
datagrid1.DataSource = Ds
datagrid1.DataBind()
wcaruso welcome to the forum..
Try looking at this sample at:-
http://aspnet101.com/aspnet101/aspn...e.aspx?code=md2
It should guide you.
Also try seeing through quickstart at:-
http://asp.net/Tutorials/quickstart.aspx
Hope that helps
Patrick
<wcaruso@.gmail.com> wrote in message
news:1130962262.235096.310430@.g44g2000cwa.googlegr oups.com...
> Good afternoon. I'm in the midst of writing up a pretty "basic" web
> form and having some difficulties. I'm completely open for
> suggestions. I'm using VS.net 2003, and what iwould like to accomplish
> is to have a form with two dropdown Boxes a button and a datagrid to
> display what was selected from the drop downs. One of the drop downs
> values can not be used more than once while the others can be repeated
> as often as they like. Being that I'm a somewhat new developer I'm
> finding even the easiest tasks to be difficult. The DropDownBoxes are
> server controls that I pre-populated from in the aspx html. These
> values will change very infrequently, so editing the aspx to add more
> shouldn't be a problem. The problem that I'm having is that I can not
> get any values to show in the Data Grid. These values must also be
> stored in a DB that I created. I'm confused on what Data Controls I
> would need, how to configure them. I have a SQLConnection control and
> it is, to my belief able to connect to the DB. I have also read to
> have a SQLCommand control and a SQLDataAdapter control. Any assistance
> is greatly appreciated. Thanks, Will
0 comments:
Post a Comment