473,411 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How display Result from sqlCommand select in the Datagridview

Hi all

How can I display the result of a sqlcommand select in a datagridview.

I guess need a dataset as result to connet it as datasource to the
datagrid?
Thanks in advance

Manfred
Mar 23 '06 #1
3 6067
Manfred,

Yes, in fact the most simple a datatable.

Use a sqldataadapter to fill that dataset

Cor

"Manfred" <mm*@USENEThsk.ch> schreef in bericht
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi all

How can I display the result of a sqlcommand select in a datagridview.

I guess need a dataset as result to connet it as datasource to the
datagrid?
Thanks in advance

Manfred

Mar 23 '06 #2
How can I get the data from the datareader object into the datatable? As
I assume the only way to retrieve the data from the command object is
the datareader Object, is this right? I'm new to vb.net.

regards

Manfred

Cor Ligthert [MVP] wrote:
Manfred,

Yes, in fact the most simple a datatable.

Use a sqldataadapter to fill that dataset

Cor

"Manfred" <mm*@USENEThsk.ch> schreef in bericht
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi all

How can I display the result of a sqlcommand select in a datagridview.

I guess need a dataset as result to connet it as datasource to the
datagrid?
Thanks in advance

Manfred



Mar 23 '06 #3
Manfred,

The datareader you would only use if you have to do things sequential.

For normal fetching of data you use in Net the DataAdapter, or the
TableAdapter.

The TableAdapter wraps the DataAdapter.
The DataAdapter wraps for getting the data the DataReader

http://msdn2.microsoft.com/en-us/lib...taadapter.aspx

I hope this gives some ideas

Cor
"Manfred" <mm*@USENEThsk.ch> schreef in bericht
news:%2****************@tk2msftngp13.phx.gbl...
How can I get the data from the datareader object into the datatable? As
I assume the only way to retrieve the data from the command object is
the datareader Object, is this right? I'm new to vb.net.

regards

Manfred

Cor Ligthert [MVP] wrote:
Manfred,

Yes, in fact the most simple a datatable.

Use a sqldataadapter to fill that dataset

Cor

"Manfred" <mm*@USENEThsk.ch> schreef in bericht
news:ux**************@TK2MSFTNGP10.phx.gbl...
> Hi all
>
> How can I display the result of a sqlcommand select in a datagridview.
>
> I guess need a dataset as result to connet it as datasource to the
> datagrid?
>
>
> Thanks in advance
>
> Manfred


Mar 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Adam | last post by:
I am having difficulty retrieving images from a SQL database. Here is the code I use to UPLOAD the image to the database: <form id="Form1" method="post" enctype="multipart/form-data"...
10
by: Viktor Popov | last post by:
Hi , I have the following SP: CREATE PROCEDURE prSVUSERINFO @USRNAM VARCHAR(20), @USRPSW VARCHAR(20), @NAME VARCHAR(64), @ADDR VARCHAR(74), @EML VARCHAR(64), @ROLE VARCHAR(6), @RCOUNT INT...
15
by: AussieRules | last post by:
Hi, I have a need to do two selects against to stored proc's in my SQL db. At the moment, each SP is called and two different dataset are populate. Thats two round trips to the SQL server. ...
9
by: Ben R. | last post by:
Hi guys, I've got a DB table of timecards with these fields in the table: ID (Int) UserID (Int) DateWorked (DateTime) HoursWorkedOnThatDate (Double) I'd like to display a grid, with...
18
by: Terry Holland | last post by:
I have an asp.net (1.1) application that connects to a SQL server 2000 db. I have a stored procedure in my db that out puts data in xml format. What I need to be able to do is display that xml...
3
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
10
by: Tony K | last post by:
How would I assign the result of a SQL query to a variable. The result of the following statement will ALWAYS result in 1 row returned. SELECT ProductDescription, ProductID FROM ...
8
by: Mai Phuong | last post by:
Hi all, I have some following code: DataTable dt = m_Data.GetInfo(); GridView1.DataSource = dt; GridView1.DataBind();
1
by: thesti | last post by:
hello, i usually simply use DataAdapter or DataReader to get data from database.now, i'm thinking to use ORM to help ease OO development. but then because i have the need to display the data...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.