Advertisement

02.08.2005 at 08:20AM PST, ID: 21306419
[x]
Attachment Details

Datagrid fill from query

Asked by nurbek in Microsoft Visual Basic.Net

Tags: datagrid, fill, query

Hi all

I am trying to fill the datagrid from the query
I have textboxes, comboboxes and checkboxes
and i create a query according to those fields

How can I display them on the datagrid?

"Select mName As " & NameLang & ", mSurnamae As " & SurnameLang & "," etc...

Where NameLang, etc changes acording to selected language

there are more than one tables and they may need to joined

here is how i fill the datagrid

        Dim strSQL As String
        Dim Conn As OleDbConnection

        Dim objDA As OleDbDataAdapter
        Dim objDS As New DataSet

        Conn = New OleDbConnection(GetDSN)
        strSQL = "SELECT * FROM students"

        objDA = New OleDbDataAdapter(strSQL, Conn)
        objDA.Fill(objDS, "mytable")
        'Bind the DataSet to DataGrid.
        txtOutput.SetDataBinding(objDS, "mytable")

        Conn.Close()
        Conn = Nothing


Thanks in advance

Start Free Trial
[+][-]02.08.2005 at 12:06PM PST, ID: 13257976

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2005 at 02:10PM PST, ID: 13259289

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.08.2005 at 02:22PM PST, ID: 13259386

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.23.2005 at 01:42PM PST, ID: 13387398

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.26.2005 at 10:15PM PST, ID: 13413170

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: datagrid, fill, query
Sign Up Now!
Solution Provided By: OzzMod
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32