Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
.NET Framework GroupsView
.NET Distributed_Apps
.NET
.NET ADO.NET
.NET ASP.NET
.NET ASP.NET Security
.NET ASP.NET Webcontrols
.NET ASP.NET Web Services
.NET Clr
.NET Compact Framework
.NET Drawing
.NET Interop
.NET Performance
.NET Web Services
.NET Windows Forms
.NET Windows Forms Controls
.NET General
.NET Csharp
.NET Visual Basic
.NET Vc
.NET Security
.NET Xml
Vsnet Debugging
Xml
Xsl
Scripting Jscript
Scripting Visual Basicscript
Scripting Wsh
Smartphone Developer
Visual Basic Com
Visual Basic Controls
Visual Basic Crystal
Visual Basic Database Ado
Visual Basic Syntax
Visual Basic Winapi
Vc Atl
Vc Debugger
Vc Language
Vc Mfc
Vc Stl
Visio Developer Visual Basica
Windowsce Embedded Vc
Windows Powershell
Visual Basic Vista Compatibility
Deployment Server
.NET Micro Porting

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Apps
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft NET Visual Basic Posts  Ask A New Question 

QueriesTableAdapter

peterg1234 posted on Sunday, March 02, 2008 10:27 PM

Newbie question:

I have created a custom query using the Query Builder, and it shows up
as a QueriesTableAdapter entry in the .xsd file. Now, how do I make
the results of this query available to a grid object on my form? IOW,
how do I make it a data source?


TIA
reply

 

Peter-Set the XSD file in DataSet mode on your designer(left bellow)right

Cor Ligthert[MVP] posted on Monday, March 03, 2008 12:36 AM

Peter-

Set the XSD file in DataSet mode on your designer(left bellow)
right click and tell to generate a dataset

-Cor
reply

Using the wizards will restrict your objects considerably.

Rich P posted on Monday, March 03, 2008 4:40 PM

Using the wizards will restrict your objects considerably.  You are
better off doing this in code as follows (I am using Windows
Authentication in this sample if you are using Sql Server):

--------------------------------------------
Imports System
Imports System.Data.SqlClient

Dim conn As SqlConnection, da As SqlDataAdapter
Dim ds As Dataset

Private Sub Form1_Load(...) Handles MyBase.Load
conn1 = New SqlConnection
conn1.ConnectionString = "Data Source=yourSvr;Initial
Catalog=yourDB;Integrated Security=True"

ds = New Dataset
da = New SqlDataAdapter
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = conn
da.SelectCommand = "Select * From yourTbl"
da.Fill(ds, "tblSteve")

datagridview1.DataSource = ds.Tables("tblSteve")
End Sub
----------------------------------------------

Just create a new form and drop a datagridview control on it.  Then copy
and paste the code above into your new form.  Replace yourTbl with the
name of an actual table on your server DB.  Now load the project and you
will see the data in your form's datagridview control.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
reply

QueriesTableAdapter

peterg1234 posted on Monday, March 03, 2008 6:56 PM

Thanks Rich - that is what I was looking for.
reply

Rich,This is a complete different result then using the designer.

Cor Ligthert[MVP] posted on Monday, March 03, 2008 11:50 PM

Rich,

This is a complete different result then using the designer.

Be aware that you are now using a non strongly typed dataset, which is in
fact complete different (less stable) then a strongly typed dataset created
using an XSD file.

Cor
reply

Pete-I don't mean to sound stupid, but could you clarify the result you want

Cor Ligthert[MVP] posted on Monday, March 03, 2008 11:53 PM

Pete-

I don't mean to sound stupid, but could you clarify the result you want to
get.
Right now, I am looking at a solution for a non strongly typed dataset which
does not have a
QueriesTableAdapter object containing your SQL -- qryIssuesList().

What has this to do with a xsd file into?

TIA,
Cor
reply

I don't mean to sound stupid, but could you clarify the steps I needto take.

peterg1234 posted on Wednesday, March 05, 2008 5:13 AM

I don't mean to sound stupid, but could you clarify the steps I need
to take. Right now, I am looking at a dataset.xsd file which has a
QueriesTableAdapter object containing my SQL -- qryIssuesList().

How do I set the xsd file into dataset mode? How do I tell it to
generate a dataset?

TIA,
Pete



On Mar 2, 9:36 pm, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
reply


Previous Microsoft NET Visual Basic conversation.