473,473 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sql string to gridview

Hi

I have an sql string. What mechanism can I use to execute it and assign the
result to a gridview?

Thanks

Regards
Jan 8 '08 #1
7 1278
On Jan 8, 6:08 am, "John" <J...@nospam.infovis.co.ukwrote:
Hi

I have an sql string. What mechanism can I use to execute it and assign the
result to a gridview?

Thanks

Regards
Against what type of datasource? Also, the objects you'll need most
likely reside in the System.Data namespace, so you might start
browsing through them in object browser and try to find the
appropriate classes.

Thanks,

Seth Rowe [MVP]
Jan 8 '08 #2
The actual database is access.

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:6d**********************************@p69g2000 hsa.googlegroups.com...
On Jan 8, 6:08 am, "John" <J...@nospam.infovis.co.ukwrote:
>Hi

I have an sql string. What mechanism can I use to execute it and assign
the
result to a gridview?

Thanks

Regards

Against what type of datasource? Also, the objects you'll need most
likely reside in the System.Data namespace, so you might start
browsing through them in object browser and try to find the
appropriate classes.

Thanks,

Seth Rowe [MVP]

Jan 8 '08 #3
Can I use Linq for example?

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:6d**********************************@p69g2000 hsa.googlegroups.com...
On Jan 8, 6:08 am, "John" <J...@nospam.infovis.co.ukwrote:
>Hi

I have an sql string. What mechanism can I use to execute it and assign
the
result to a gridview?

Thanks

Regards

Against what type of datasource? Also, the objects you'll need most
likely reside in the System.Data namespace, so you might start
browsing through them in object browser and try to find the
appropriate classes.

Thanks,

Seth Rowe [MVP]

Jan 8 '08 #4
Can I use Linq for example?

I wouldn't, I would use the OleDb components and access it like a
normal database.

Thanks,

Seth Rowe [MVP]
Jan 8 '08 #5
Actually currently there is no way (out of the box) to query the access
database using LINQ.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:6e**********************************@y5g2000h sf.googlegroups.com...
>Can I use Linq for example?

I wouldn't, I would use the OleDb components and access it like a
normal database.

Thanks,

Seth Rowe [MVP]
Jan 8 '08 #6
What oledb code can I use to accomplish this?

Thanks

Regards

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:6e**********************************@y5g2000h sf.googlegroups.com...
>Can I use Linq for example?

I wouldn't, I would use the OleDb components and access it like a
normal database.

Thanks,

Seth Rowe [MVP]

Jan 8 '08 #7
"John" <Jo**@nospam.infovis.co.ukschrieb:
>I wouldn't, I would use the OleDb components and access it like a
normal database.

What oledb code can I use to accomplish this?
How to use Microsoft Visual Basic .NET to connect to a Microsoft Access
database and to retrieve data
<URL:http://support.microsoft.com/?scid=kb;EN-US;821765>

Once you have the dataset containing the data, you can create a
'BindingSource' object, assign the 'DataSet' object to its 'DataSource'
property and then assign the binding source to the datagridview control's
'DataSource' property, for example.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 9 '08 #8

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

Similar topics

3
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
6
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the...
2
by: John A Grandy | last post by:
VS05 : GridView control config'd to use SPs in SS05 One of the SPs takes a vchar(50) which in the T-SQL needs to be converted to a DateTime. How should I have the GridView format the text the...
7
by: M C | last post by:
Hi, This is a problem that has been haunting me for days and I've come to a complete dead-end. I'm using a objectdatasource to select and update a gridview control. Populating with select works...
10
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not...
5
by: BenG | last post by:
Hi. I have a gridview control on a web form (asp.net 2.0) that's bound to a objectDataSource. The objectdatasource which is bound to a class I've written in the DAL to read and update the database....
5
by: Sobin Thomas | last post by:
Hi All, I want to pass a string that contains many special characters (: \ . _ etc) to another page in my website through query string. In my project I have a Gridview control ,in which there...
2
by: Andy B | last post by:
I don't know if this is even working or not but here is the problem. I have a gridview that I databound to a dictionary<string, stringcollection: Contract StockContract = new Contract();...
2
by: tonymcq | last post by:
I am very new to VB.net / ASP and have spent hours and hours trying to solve what must be a simple problem - hopefully someone can point me in the right direction. I have a gridview bound to an...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
0
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,...
0
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...
1
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
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,...
1
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: 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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.