Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: sqldatareader from dataset


Message #1 by "Alex Smotritsky" <alex.smotritsky@v...> on Wed, 19 Feb 2003 23:22:29
I'm looking for some help on instantiating a SqlDataReader from a DataSet 
in C#, thanks in advance!
Message #2 by "h@f... on Wed, 19 Feb 2003 20:53:53 -0800 (PST)
i am sending u a code in vb.net.change it into C#.net. and i am using SQlServer 2000 and DataSource is PUBS.

Dim query As String = "select au_fname from authors"

Dim constr As String = "Initial Catalog=pubs;Data Source=localhost;" & _

"Integrated Security=SSPI;"

Dim con As SqlConnection = New SqlConnection(constr)

Dim com As SqlCommand = New SqlCommand(query, con)

Dim reader As SqlDataReader

Try

con.open()

reader = com.executeReader()

While reader.Read()

Console.WriteLine(reader.GetString(0))

End While

Catch ex As SqlException

Console.Write(ex.Message)

Finally

reader.Close()

con.Close()

End Try

'Hafiz Qasim

'Final Semester( MCS )

'Punjab University, Lahore

Alex Smotritsky <alex.smotritsky@v...> wrote:I'm looking for some help on instantiating a SqlDataReader from a DataSet 
in C#, thanks in advance!
===
Fast Track ADO.NET with C# is a concise introduction to the concepts, techniques, and libraries that you will need in order to start
using ADO.NET in your applications. The book covers DataSets and Typed DataSets, accessing data using DataReaders and DataAdaptors,
the close relationship between ADO.NET and XML, how and where to use ADO.NET in your enterprise applications, and how to use Web
Services and ADO.NET to easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more
Message #3 by "Alex Smotritsky" <alex.smotritsky@v...> on Thu, 20 Feb 2003 01:00:02 -0500
Thanks a lot Hafiz.


-----Original Message-----
From: h@f... [mailto:hafizqasim@y...] 
Sent: Wednesday, February 19, 2003 11:54 PM
To: ADO.NET
Subject: [ado_dotnet] Re: sqldatareader from dataset



i am sending u a code in vb.net.change it into C#.net. and i am using
SQlServer 2000 and DataSource is PUBS.

Dim query As String = "select au_fname from authors"

Dim constr As String = "Initial Catalog=pubs;Data Source=localhost;" & _

"Integrated Security=SSPI;"

Dim con As SqlConnection = New SqlConnection(constr)

Dim com As SqlCommand = New SqlCommand(query, con)

Dim reader As SqlDataReader

Try

con.open()

reader = com.executeReader()

While reader.Read()

Console.WriteLine(reader.GetString(0))

End While

Catch ex As SqlException

Console.Write(ex.Message)

Finally

reader.Close()

con.Close()

End Try

'Hafiz Qasim

'Final Semester( MCS )

'Punjab University, Lahore

Alex Smotritsky <alex.smotritsky@v...> wrote:I'm looking for some
help on instantiating a SqlDataReader from a DataSet 
in C#, thanks in advance!
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm

Message #4 by "h@f... on Thu, 20 Feb 2003 00:40:25 -0800 (PST)
Hi, Alex 
Include this line at the start of the page when u start database programs.
improts system.data.sqlclien
or imports system.data.oledb
Note: this should be the first line in the ur source code area 
 Alex Smotritsky <alex.smotritsky@v...> wrote:Thanks a lot Hafiz.


-----Original Message-----
From: h@f... [mailto:hafizqasim@y...] 
Sent: Wednesday, February 19, 2003 11:54 PM
To: ADO.NET
Subject: [ado_dotnet] Re: sqldatareader from dataset



i am sending u a code in vb.net.change it into C#.net. and i am using
SQlServer 2000 and DataSource is PUBS.

Dim query As String = "select au_fname from authors"

Dim constr As String = "Initial Catalog=pubs;Data Source=localhost;" & _

"Integrated Security=SSPI;"

Dim con As SqlConnection = New SqlConnection(constr)

Dim com As SqlCommand = New SqlCommand(query, con)

Dim reader As SqlDataReader

Try

con.open()

reader = com.executeReader()

While reader.Read()

Console.WriteLine(reader.GetString(0))

End While

Catch ex As SqlException

Console.Write(ex.Message)

Finally

reader.Close()

con.Close()

End Try

'Hafiz Qasim

'Final Semester( MCS )

'Punjab University, Lahore

Alex Smotritsky wrote:I'm looking for some
help on instantiating a SqlDataReader from a DataSet 
in C#, thanks in advance!
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


===
Fast Track ADO.NET with C# is a concise introduction to the concepts, techniques, and libraries that you will need in order to start
using ADO.NET in your applications. The book covers DataSets and Typed DataSets, accessing data using DataReaders and DataAdaptors,
the close relationship between ADO.NET and XML, how and where to use ADO.NET in your enterprise applications, and how to use Web
Services and ADO.NET to easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more
Message #5 by "Mallikarjuna" <mallikarjuna@i...> on Thu, 20 Feb 2003 14:23:04 +0530
hai,
try to bind the same data reader with multiple drop down controls.
Mallik

----- Original Message -----
From: "h@f..." <hafizqasim@y...>
To: "ADO.NET" <ado_dotnet@p...>
Sent: Thursday, February 20, 2003 2:10 PM
Subject: [ado_dotnet] Re: sqldatareader from dataset


>
> Hi, Alex
> Include this line at the start of the page when u start database programs.
> improts system.data.sqlclien
> or imports system.data.oledb
> Note: this should be the first line in the ur source code area
>  Alex Smotritsky <alex.smotritsky@v...> wrote:Thanks a lot Hafiz.
>
>
> -----Original Message-----
> From: h@f... [mailto:hafizqasim@y...]
> Sent: Wednesday, February 19, 2003 11:54 PM
> To: ADO.NET
> Subject: [ado_dotnet] Re: sqldatareader from dataset
>
>
>
> i am sending u a code in vb.net.change it into C#.net. and i am using
> SQlServer 2000 and DataSource is PUBS.
>
> Dim query As String = "select au_fname from authors"
>
> Dim constr As String = "Initial Catalog=pubs;Data Source=localhost;" & _
>
> "Integrated Security=SSPI;"
>
> Dim con As SqlConnection = New SqlConnection(constr)
>
> Dim com As SqlCommand = New SqlCommand(query, con)
>
> Dim reader As SqlDataReader
>
> Try
>
> con.open()
>
> reader = com.executeReader()
>
> While reader.Read()
>
> Console.WriteLine(reader.GetString(0))
>
> End While
>
> Catch ex As SqlException
>
> Console.Write(ex.Message)
>
> Finally
>
> reader.Close()
>
> con.Close()
>
> End Try
>
> 'Hafiz Qasim
>
> 'Final Semester( MCS )
>
> 'Punjab University, Lahore
>
> Alex Smotritsky wrote:I'm looking for some
> help on instantiating a SqlDataReader from a DataSet
> in C#, thanks in advance!
> ===
> Fast Track ADO.NET with C# is a concise introduction to the concepts,
> techniques, and libraries that you will need in order to start using
> ADO.NET in your applications. The book covers DataSets and Typed
> DataSets, accessing data using DataReaders and DataAdaptors, the close
> relationship between ADO.NET and XML, how and where to use ADO.NET in
> your enterprise applications, and how to use Web Services and ADO.NET to
> easily pass data between applications.
> http://www.wrox.com/books/1861007604.htm
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, and more
>
> ===
> Fast Track ADO.NET with C# is a concise introduction to the concepts,
> techniques, and libraries that you will need in order to start using
> ADO.NET in your applications. The book covers DataSets and Typed
> DataSets, accessing data using DataReaders and DataAdaptors, the close
> relationship between ADO.NET and XML, how and where to use ADO.NET in
> your enterprise applications, and how to use Web Services and ADO.NET to
> easily pass data between applications.
> http://www.wrox.com/books/1861007604.htm
>
>
> ===
> Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using ADO.NET
in your applications. The book covers DataSets and Typed DataSets, accessing
data using DataReaders and DataAdaptors, the close relationship between
ADO.NET and XML, how and where to use ADO.NET in your enterprise
applications, and how to use Web Services and ADO.NET to easily pass data
between applications.
> http://www.wrox.com/books/1861007604.htm
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, and more
>
> ===
> Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using ADO.NET
in your applications. The book covers DataSets and Typed DataSets, accessing
data using DataReaders and DataAdaptors, the close relationship between
ADO.NET and XML, how and where to use ADO.NET in your enterprise
applications, and how to use Web Services and ADO.NET to easily pass data
between applications.
> http://www.wrox.com/books/1861007604.htm
>
>

Message #6 by "Alex Smotritsky" <alex.smotritsky@v...> on Thu, 20 Feb 2003 04:10:45 -0500
Thanks!


-----Original Message-----
From: h@f... [mailto:hafizqasim@y...] 
Sent: Thursday, February 20, 2003 3:40 AM
To: ADO.NET
Subject: [ado_dotnet] Re: sqldatareader from dataset



Hi, Alex 
Include this line at the start of the page when u start database
programs. improts system.data.sqlclien or imports system.data.oledb
Note: this should be the first line in the ur source code area 
 Alex Smotritsky <alex.smotritsky@v...> wrote:Thanks a lot Hafiz.


-----Original Message-----
From: h@f... [mailto:hafizqasim@y...] 
Sent: Wednesday, February 19, 2003 11:54 PM
To: ADO.NET
Subject: [ado_dotnet] Re: sqldatareader from dataset



i am sending u a code in vb.net.change it into C#.net. and i am using
SQlServer 2000 and DataSource is PUBS.

Dim query As String = "select au_fname from authors"

Dim constr As String = "Initial Catalog=pubs;Data Source=localhost;" & _

"Integrated Security=SSPI;"

Dim con As SqlConnection = New SqlConnection(constr)

Dim com As SqlCommand = New SqlCommand(query, con)

Dim reader As SqlDataReader

Try

con.open()

reader = com.executeReader()

While reader.Read()

Console.WriteLine(reader.GetString(0))

End While

Catch ex As SqlException

Console.Write(ex.Message)

Finally

reader.Close()

con.Close()

End Try

'Hafiz Qasim

'Final Semester( MCS )

'Punjab University, Lahore

Alex Smotritsky wrote:I'm looking for some
help on instantiating a SqlDataReader from a DataSet 
in C#, thanks in advance!
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


  Return to Index