.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification