Data Access in web forms

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

Hello

I'm trying to make my first asp.net application.

Every tutorial shows how to retrieve data from database into a datagrid, or
datalist or repeter.

What if you have multiple texboxes, comboboxes and radio buttons, and you
want to populate those from the database.

How do we do this ?

I created the text boxes and from the gui, I use databinding property to
connect text to dataset.table.defaultview[0].field

I put

daAdapter.Fill(dsDataSet) in the page_load event.

but nothing gets populated in the text boxes.

Is there any sample where it shows/teaches data access without a datagrid ?

Thanks

Hemang
 
J

Jeffrey Todd

You might try calling .DataBind() on each textbox after setting the other
data binding-related properties and filling the DataSet.

-HTH
 
N

news.microsoft.com

Thanks Jeffrey

I tried that, it did not work.

This is my page load function:

private void Page_Load(object sender, System.EventArgs e)

{

daReview.Fill(dsCaseReview);

Page.DataBind();

txtReviewDate.DataBind(); // I set this after your post although
Page.DataBind(); should be sufficient.

}





Jeffrey Todd said:
You might try calling .DataBind() on each textbox after setting the other
data binding-related properties and filling the DataSet.

-HTH


news.microsoft.com said:
Hello

I'm trying to make my first asp.net application.

Every tutorial shows how to retrieve data from database into a datagrid,
or datalist or repeter.

What if you have multiple texboxes, comboboxes and radio buttons, and you
want to populate those from the database.

How do we do this ?

I created the text boxes and from the gui, I use databinding property to
connect text to dataset.table.defaultview[0].field

I put

daAdapter.Fill(dsDataSet) in the page_load event.

but nothing gets populated in the text boxes.

Is there any sample where it shows/teaches data access without a datagrid
?

Thanks

Hemang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top