473,811 Members | 3,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6088
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******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP10.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******** ********@tk2msf tngp13.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******** ******@TK2MSFTN GP10.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
2108
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" runat="server"> <INPUT id="UploadedImageFile" runat=server type="file" size="86"> </form>
10
1371
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 OUTPUT
15
6518
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. I can combine the two SP into one, and have one SP that executes two Select Statements, and effectivly returns two result sets, and I could call this with one trip to the SQL server from my VB app.
9
1956
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 Monday - Sunday across the top (in columns)
18
3213
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 that I retrieve from my stored proc and display it in a web page formatted as I want. I have managed to get my xml to display as I wish if I manually run my stored proc in QA and copy the xml into notepad and save it as Test.xml. I reference my xsl...
3
5250
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 database and display it in a Image web control dynamically(at runtime). The process after being displayed in the web control, user click insert/add button, it converts the image(jpeg) file to bytes and store it the database with Image or VarBinary...
10
11320
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 Products WHERE (ProductIDNumber = ?) How do I assign the...say, ProductDescription to a variable called prodDesc? Thanks,
8
6833
by: Mai Phuong | last post by:
Hi all, I have some following code: DataTable dt = m_Data.GetInfo(); GridView1.DataSource = dt; GridView1.DataBind();
1
1611
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 in a DataGridView, filling query result to a DataTable from a DataAdapter is simple enough. i don't know if it's better to use ORM or not. is filling data generated from ORM to a DataGridView is simple enough? if the ORM framework used is...
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10397
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10413
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9214
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7674
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3027
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.