FillDataSet command
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-sqlclient' list.


denny L
-- Moved from [aspngfreeforall] to [ngfx-sqlclient] by Marcie Jones <Click here to reveal e-mail address> --

Guys,

I have this old code that used to work on B2/B1.
But now keep getting stuck at FillDataSet (code below at the last second
line).

Can you please tell me where to find the doc for converting old commands to
the new?

Thanks much!
==========================================================
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data"    %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script language="C#" runat="server" debug="true">
...
        String scn = "server=localhost;uid=sa;pwd=;database=pubs";
        String sSQL = "SELECT * From tusers where lname = '" + txtPassword.Text +
"' And fname = '" + txtName.Text + "'";
        SqlConnection myCn = new SqlConnection(scn);
        SqlCommand cmd = new SqlCommand(sSQL, myCn);

        DataSet ds= new DataSet();
        cmd.FillDataSet(ds, "tusers");
        DataRow[] dRow = ds.Tables["tusers"].Rows.All;
==========================================================
denny

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

Reply to this message...
 
    
Tim Musschoot
Hello,

Try this:

String scn = "server=localhost;uid=sa;pwd=;database=pubs";
String sSQL = "SELECT * From tusers where lname = '" + txtPassword.Text + "'
And fname = '" + txtName.Text + "'";
SqlConnection myCn = new SqlConnection(scn);

DataSet ds= new DataSet("tusers");
SqlDataAdapter da = new SqlDataAdapter(sSQL,scn);
da.Fill(ds,"tusers");

DataRow[] dRow = ds.Tables["tusers"].Rows;

I have no idea if such a doc exists. Maybe you can check the msdn
(msdn.microsoft.com/library)

Best regards,
Tim Musschoot
AspFriends Moderation Team
Click here to reveal e-mail address
http://www.aspalliance.com/tim_musschoot

-----Oorspronkelijk bericht-----
Van: denny L [mailto:Click here to reveal e-mail address]
Verzonden: dinsdag 18 juni 2002 22:48
Aan: ngfx-sqlclient
Onderwerp: [ngfx-sqlclient] FillDataSet command

-- Moved from [aspngfreeforall] to [ngfx-sqlclient] by Marcie Jones
<Click here to reveal e-mail address> --

Guys,

I have this old code that used to work on B2/B1.
But now keep getting stuck at FillDataSet (code below at the last second
line).

Can you please tell me where to find the doc for converting old commands to
the new?

Thanks much!
==========================================================
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data"    %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script language="C#" runat="server" debug="true">
...
        String scn = "server=localhost;uid=sa;pwd=;database=pubs";
        String sSQL = "SELECT * From tusers where lname = '" + txtPassword.Text +
"' And fname = '" + txtName.Text + "'";
        SqlConnection myCn = new SqlConnection(scn);
        SqlCommand cmd = new SqlCommand(sSQL, myCn);

        DataSet ds= new DataSet();
        cmd.FillDataSet(ds, "tusers");
        DataRow[] dRow = ds.Tables["tusers"].Rows.All;
==========================================================
denny

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

| [ngfx-sqlclient] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-sqlclient.asp = JOIN/QUIT

Reply to this message...
 
    
Daniel Naumann
Hi Denny,

Things changed a bit fro B2 to RTM. You'll need a DataAdapter in there now to
do the fill.

Here is a SDK link (watch the wrap):
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdatacommondbdataadapterclassfi
lltopic.htm

And very luckily for you I just happened to come across an article that
describes the changes from DataSetCommand to DataAdapter:
http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=83

Daniel.

-----Original Message-----
From: denny L [mailto:Click here to reveal e-mail address]
Sent: 19-Jun-2002 06:48
To: ngfx-sqlclient
Subject: [ngfx-sqlclient] FillDataSet command

-- Moved from [aspngfreeforall] to [ngfx-sqlclient] by Marcie Jones
<Click here to reveal e-mail address> --

Guys,

I have this old code that used to work on B2/B1.
But now keep getting stuck at FillDataSet (code below at the last second
line).

Can you please tell me where to find the doc for converting old commands to
the new?

Thanks much!
==========================================================
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data"    %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script language="C#" runat="server" debug="true">
...
        String scn = "server=localhost;uid=sa;pwd=;database=pubs";
        String sSQL = "SELECT * From tusers where lname = '" + txtPassword.Text +
"' And fname = '" + txtName.Text + "'";
        SqlConnection myCn = new SqlConnection(scn);
        SqlCommand cmd = new SqlCommand(sSQL, myCn);

        DataSet ds= new DataSet();
        cmd.FillDataSet(ds, "tusers");
        DataRow[] dRow = ds.Tables["tusers"].Rows.All;
==========================================================
denny

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

| [ngfx-sqlclient] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-sqlclient.asp = JOIN/QUIT

Reply to this message...
 
 
System.Data.Common.DataAdapter
System.Data.DataRow
System.Data.DataSet
System.Data.SqlClient.SqlCommand
System.Data.SqlClient.SqlConnection
System.Data.SqlClient.SqlDataAdapter




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com