Web App with Dataset problems.

  • Thread starter Thread starter TonyM
  • Start date Start date
T

TonyM

Hi all,

First, Let me say I feel like a complete idiot here, and shamefully come to
you for help. I've read and read and can't get this to work in a web
application, however in a windows application I have no problems. Here it
is:

I have an sqlDataAdapter, sqlDataConnection, and a DataSet. If I right
click on sqlDataAdapter1 and select "Preview Data" and then Fill the
DataSet, it looks fine, my entries in the table (named headerInfo) show up
along with the Column structure.

Now, I have a few editboxes and buttons on the webapp page. When I click on
a button I would like to have the data in the dataset populate the edit
boxes. I've set the databindings in each editbox's properties to the
appropriate field from the dataset. I set the button click event up as
follows:

private void btnRead_Click(object sender, System.EventArgs e)
{
sqlConnection1.Open();
sqlDataAdapter1.Fill(dsHeader1,0,0, "headerInfo");
sqlConnection1.Close();
}

Can someone please tell me how to get the first record of information from
the table "headerInfo", in the Column "Title" to appear as thed text for the
editbox?

I know this is probably something simple, and I am completely missing
something. Any help would be appreciated.

Please don't laugh at me (too much).

Thanks in advance.
 
Jayson said:
you need to call the DataBind method of each control

jayson

Jayson:

Thank you very much for your help, it's working!

One other question, when populating a drop down box the string is being
broken up into seperate chars, so the word "Windows" would be 7 selections,
W, I, N,D,O,W, and S. the field in the DB is set to "text". do you know
how to work around this?

Thanks again.
 
Back
Top