easy newbie question 
Author Message
 easy newbie question

I'm getting swamped in all these articles showing how to use grids and
templates to show database data. Can someone please give me an example of
how to simply retrieve a few records and manipulate the results, instead of
displaying them in some fancy way?

For example, checking a database to see if a login is valid, or returning a
recordset with a certain ID.

Please help! Thanks! :-)



Sun, 12 Sep 2004 12:38:56 GMT  
 easy newbie question
Hello James,

You can fill a DataSet with a DataAdapter and specify the SQL command in
the DataAdapter object. This is a sample code:

OleDbConnection nwindConn = new OleDbConnection("Provider=SQLOLEDB;Data
Source=localhost;" +
        "Integrated Security=SSPI;Initial Catalog=northwind");

OleDbCommand selectCMD = new OleDbCommand("SELECT CustomerID, CompanyName
FROM Customers", nwindConn);
selectCMD.CommandTimeout = 30;

OleDbDataAdapter custDA = new OleDbDataAdapter();
custDA.SelectCommand = selectCMD;

DataSet custDS = new DataSet();
custDA.Fill(custDS, "Customers");

For more information about using a dataSet with existing data please see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...
l/cpconusingdatasetwithexistingdata.asp

I hope this is helpful.

Best regards,

Lion Shi, MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2001 Microsoft Corporation. All rights
reserved.
--------------------

    Subject: easy newbie question
    Date: Tue, 26 Mar 2002 21:38:56 -0700
    Lines: 11
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
    X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700

    Newsgroups: microsoft.public.dotnet.languages.CSharp
    NNTP-Posting-Host: ip68-2-164-106.ph.ph.cox.net 68.2.164.106
    Path: cpmsftngxa08!cpmsftngxa09!tkmsftngp01!tkmsftngp04
    Xref: cpmsftngxa08 microsoft.public.dotnet.languages.csharp:48504
    X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

    I'm getting swamped in all these articles showing how to use grids and
    templates to show database data. Can someone please give me an example
of
    how to simply retrieve a few records and manipulate the results,
instead of
    displaying them in some fancy way?

    For example, checking a database to see if a login is valid, or
returning a
    recordset with a certain ID.

    Please help! Thanks! :-)



Mon, 13 Sep 2004 14:18:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Easy newbie question

2. Easy newbie question

3. Easy Newbie Question

4. Easy Newbie Question:

5. Easy Newbie question How to process the contents of a structure

6. Easy Newbie Question: CEDIT backcolor

7. Easy Newbie Question:

8. EASY NEWBIE QUESTION!!! How to get the current IP address...

9. IMPORTANT -- And easy to answer - semi-newbie Socket/Telnet question

10. I'm a newbie but easy question

11. A newbie with a easy question

12. NEWBIE QUESTION PROBABLY EASY

 

 
Powered by phpBB® Forum Software