473,405 Members | 2,279 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,405 software developers and data experts.

Datasource from string

Hi

Is it possible to create a datasource for dataview control for an sql
string?

Thanks

Regards
Mar 18 '08 #1
4 1054
John,

A dataview is not a control, it is a view on the datatable.

Cor
"John" <in**@nospam.infovis.co.ukschreef in bericht
news:Oq**************@TK2MSFTNGP05.phx.gbl...
Hi

Is it possible to create a datasource for dataview control for an sql
string?

Thanks

Regards
Mar 18 '08 #2
John,

Not really. You need to create a new datasource that uses your sql string:

Dim sql as String = "SELECT * FROM Table1"
Dim con as String = "Data Source=Northwind;Initial Catalog=Table1;Integrated
Security=True"
Dim ds as DataSource = new DataSource(sql, con)

The code above is untested, though. I think it needs the sql connection
string, but I could be mistaken.

Hope that helps!

"John" wrote:
Hi

Is it possible to create a datasource for dataview control for an sql
string?

Thanks

Regards
Mar 18 '08 #3
Sorry I meant gridvview.

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:62**********************************@microsof t.com...
John,

A dataview is not a control, it is a view on the datatable.

Cor
"John" <in**@nospam.infovis.co.ukschreef in bericht
news:Oq**************@TK2MSFTNGP05.phx.gbl...
>Hi

Is it possible to create a datasource for dataview control for an sql
string?

Thanks

Regards

Mar 18 '08 #4
Not sure though what you meant ? A string is just a string, you have to
execute the Sql statement that is stored into this string to produce a
result that can then be binded to a gridview...

Search google for gridview/databind or elaborate a bit about what you are
trying to do (are you looking for SqlDataSource like objects ? -
http://msdn2.microsoft.com/en-us/lib...w(vs.80).aspx)...

--
Patrice

"John" <in**@nospam.infovis.co.uka écrit dans le message de news:
O$**************@TK2MSFTNGP05.phx.gbl...
Sorry I meant gridvview.

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:62**********************************@microsof t.com...
>John,

A dataview is not a control, it is a view on the datatable.

Cor
"John" <in**@nospam.infovis.co.ukschreef in bericht
news:Oq**************@TK2MSFTNGP05.phx.gbl...
>>Hi

Is it possible to create a datasource for dataview control for an sql
string?

Thanks

Regards


Mar 18 '08 #5

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

Similar topics

3
by: Alvaro E. Gonzalez V. | last post by:
Hello!!! I'm building a control that in a property assign a Dataset which they are initialized and another property Like DataMember. Similar as it happens to the DataSource property of a...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
3
by: Richard Ryerson | last post by:
I have a general DataGridComboBoxColumn that I built using the Example in the .NET 2003 Combined Collection help file (that was a data time picker). I am able to assign a data source and display...
4
by: SHEBERT | last post by:
Here is an example of a SortedList that works as a datasource to the ComboBox and a generic SortedList<that does not works as a datasource to the ComboBox. Why? If I use List and generic List<>,...
7
by: ThunderMusic | last post by:
Hi, This question probably went back a couple of times, but I didn't find anything about it on google, so I ask here... What is the best way to use the DataSource/DataBind pattern in a class? I...
1
by: WhiteWizard | last post by:
First my apologies, this may be longer than the normal question. I have a windows app (.NET 2.0, VS2005), and I've written a user control that will allow the user to "drag and drop" a directory...
2
by: shapper | last post by:
Hello, I created a Repeater at runtime with an AccessDataSource.Everything Works fine! Now I need to use the same repeater but with a DataSource created in my VB.Net code. I created a...
3
by: balaki | last post by:
Hi, I am working on a Installer Project, which requires to deploy SQL Server 2005 Reports (.rdl files) and Datasource (.rds file). The datasource is common for all reports. The report files are...
2
by: shahiz | last post by:
basically im having null pointer exception //read an inputstream is = new DataInputStream(new FileInputStream("test.mpg")); loadBytes(is); //pass it as a datasource for the player public...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, I used the Data Sources window to drop a custom object onto the designer surface. It created a BindingSource and BindingNavigator as a result. When I open the Properties window...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...

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.