Using SQLDataSource to fill a datatable or dataset

T

tom c

I am using Visual Web Developer 2005 Express Edition. I created a
SQLDataSource just by draging the control to the form and filling in
the blanks in the wizard.

In code I need to use the SQLDataSource to load data from several
tables into datasets or datatables, work with the data, then insert new
rows into tables in the SQL Server database.

I can not find any example code showing me how to do this. I don't
even see any example code showing me how fill a datatable using
SQLDataSource

In OLE I would just do

OleDbDataAdapter.fill(datatable)

How do I do that with a SQLDataSource?
 
J

Jay Pondy

Dim dv As System.Data.DataView
dv = CType(mdsAllowanceDebit.Select(New DataSourceSelectArguments), DataView)

If dv.Count = 1 Then
txtAmount.Text = dv(0)("Amount")
txtDescription.Text = dv(0)("Description")
txtStamp.Text = dv(0)("Stamp")
Else
txtAmount.Text = "0.00"
txtDescription.Text = String.Empty
txtStamp.Text = Now.ToShortDateString
End If
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top