Re: Listing Records From DB

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: A P (ap_at_textguru.ph)
Date: 09/16/04


Date: Thu, 16 Sep 2004 12:22:54 +0800

Thanks for your reply. How about on VB? Not familiar of C# and I only
install VB.Net on my machine.

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:uzXqTW5mEHA.3296@TK2MSFTNGP10.phx.gbl...
> You have two options, DataReader or DataSet. Here is a dataset
> implementation in C#.
>
> string connString = "YourConnStringHere";
> string sql = "SELECT * FROM SomeTable";
>
> SqlConnection conn = new SqlConnection(connString);
> SqlCommand cmd = new SqlCommand(sql, conn);
> SqlAdapter adapt = new SqlAdapter(cmd);
> DataSet ds = new DataSet();
>
> //optionally using statement here
> try
> {
> conn.Open();
> adapt.Fill(ds);
> }
> finally
> {
> if(conn.State=ConnectionState.Open)
> conn.Close();
>
> conn.Dispose();
> }
>
> DataGrid1.DataSource=ds;
> DataGrid1.DataBind();
>
> Very simple pattern. Easily adaptable.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> *************************************************
> Think outside the box!
> *************************************************
> "A P" <ap@textguru.ph> wrote in message
> news:et9rC44mEHA.3464@tk2msftngp13.phx.gbl...
> >I am new to VS.Net Professional but I am previously using Visual Interdev
> > 6.0 . I want to list records from the database thru VS.Net . Its easy on
> > Visual Interdev but in VS .Net, I dont know how. Please help me!!!
> >
> > Me
> >
> >
>
>



Relevant Pages

  • Re: .NET Framework 3 runtime on Server 2008
    ... "Cowboy (Gregory A. Beamer)" wrote: ... latest VS 2008 beta. ... when i try to install the .net 3 redistributable package it ...
    (microsoft.public.dotnet.general)
  • Re: ADO.NET Entities Failure (RTM)
    ... Gregory A. Beamer ... Installed Visual Studio SP1 ... Going to attempt a VS 2008 SP1 repair install, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Visual Studio 2005
    ... Cowboy (Gregory A. Beamer) - MVP wrote: ... > install to separate directories, you still have a danger of problems. ...
    (microsoft.public.dotnet.framework)
  • Re: Listing Records From DB
    ... install VB.Net on my machine. ... > Gregory A. Beamer ... >>I am new to VS.Net Professional but I am previously using Visual Interdev ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Including packages in a project?
    ... Is is possible something like that for beamer or other ... AUTHORS INSTALL base/ emulation/ lyx/ ... The usual TEXINPUTS path is not searched recursively: ...
    (comp.text.tex)