Using SQLDataSource to fill a datatable or dataset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tom c

    Using SQLDataSource to fill a datatable or dataset

    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

    OleDbDataAdapte r.fill(datatabl e)

    How do I do that with a SQLDataSource?

  • Jay Pondy

    #2
    Re: Using SQLDataSource to fill a datatable or dataset

    Dim dv As System.Data.Dat aView
    dv = CType(mdsAllowa nceDebit.Select (New DataSourceSelec tArguments), DataView)

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


    On 6 Sep 2006 09:52:33 -0700, "tom c" <tomcarr1@gmail .comwrote:
    >I am using Visual Web Developer 2005 Express Edition. I created a
    >SQLDataSourc e 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
    >SQLDataSourc e
    >
    >In OLE I would just do
    >
    >OleDbDataAdapt er.fill(datatab le)
    >
    >How do I do that with a SQLDataSource?

    Comment

    Working...