Click here to Skip to main content
15,896,063 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Eddy Vluggen23-Jan-12 11:07
professionalEddy Vluggen23-Jan-12 11:07 
GeneralRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Mangore7524-Jan-12 3:32
Mangore7524-Jan-12 3:32 
AnswerRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Eddy Vluggen24-Jan-12 5:13
professionalEddy Vluggen24-Jan-12 5:13 
GeneralRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Mangore7524-Jan-12 11:47
Mangore7524-Jan-12 11:47 
QuestionRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Eddy Vluggen24-Jan-12 12:03
professionalEddy Vluggen24-Jan-12 12:03 
AnswerRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Wes Aday23-Jan-12 11:28
professionalWes Aday23-Jan-12 11:28 
GeneralRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Mangore7524-Jan-12 3:34
Mangore7524-Jan-12 3:34 
AnswerRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Eddy Vluggen24-Jan-12 12:42
professionalEddy Vluggen24-Jan-12 12:42 
Mangore75 wrote:
but nothing happen

You press F5, and then you either get an exception, or a result. If you executed the code you have now, you get a MessageBox with the text "Tables". That's because the "dt" variable contains a DataTable object with tables, and if you try to show it with a MsgBox, you'll see a .ToString() version of the object.

Click on the gutter in the right on the line that says "MsgBox" and put a breakpoint there. Run your code, and hover your mouse over the "dt" variable when the yellow line hits the breakpoint.

This code worked for me;
VB.NET
Imports System.Data.OleDb

Module Module1
    Sub Main()
        Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source =""C:\Users\Eddy\Desktop\NWind.mdb""")

        conn.Open()
        Dim dt As DataTable
        dt = conn.GetSchema("TABLES")
        conn.Close()

        For Each row As DataRow In dt.Rows
            For Each item As Object In row.ItemArray
                Console.Write(item)
            Next
            Console.WriteLine()
        Next

        Console.WriteLine(dt)
        Console.ReadKey()
    End Sub
End Module

It's easier if you learn it from a book.
Bastard Programmer from Hell Suspicious | :suss:

GeneralRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Mangore7525-Jan-12 3:49
Mangore7525-Jan-12 3:49 
AnswerRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Eddy Vluggen25-Jan-12 8:55
professionalEddy Vluggen25-Jan-12 8:55 
AnswerRe: vb.net - Show the name of Table and Fields in DB Ms access Pin
Luc Pattyn23-Jan-12 11:30
sitebuilderLuc Pattyn23-Jan-12 11:30 
QuestionI want to learn about VB.net. Pin
johnskymoon23-Jan-12 10:25
johnskymoon23-Jan-12 10:25 
AnswerRe: I want to learn about VB.net. Pin
Eddy Vluggen23-Jan-12 11:03
professionalEddy Vluggen23-Jan-12 11:03 
AnswerRe: I want to learn about VB.net. Pin
Luc Pattyn25-Jan-12 6:19
sitebuilderLuc Pattyn25-Jan-12 6:19 
GeneralRe: I want to learn about VB.net. Pin
Eddy Vluggen25-Jan-12 6:47
professionalEddy Vluggen25-Jan-12 6:47 
AnswerRe: I want to learn about VB.net. Pin
ag9911001124-Jan-12 7:51
ag9911001124-Jan-12 7:51 
AnswerRe: I want to learn about VB.net. Pin
Clark Kent12325-Jan-12 5:16
professionalClark Kent12325-Jan-12 5:16 
GeneralRe: I want to learn about VB.net. Pin
Framework .l.26-Jan-12 17:37
Framework .l.26-Jan-12 17:37 
AnswerRe: I want to learn about VB.net. Pin
thatraja26-Jan-12 19:54
professionalthatraja26-Jan-12 19:54 
Questionmulti-language Pin
C#Coudou22-Jan-12 22:26
C#Coudou22-Jan-12 22:26 
AnswerRe: multi-language Pin
Eddy Vluggen23-Jan-12 0:19
professionalEddy Vluggen23-Jan-12 0:19 
AnswerRe: multi-language Pin
thatraja23-Jan-12 2:46
professionalthatraja23-Jan-12 2:46 
QuestionIs a workbook open? Pin
Fred Andres22-Jan-12 8:03
Fred Andres22-Jan-12 8:03 
AnswerRe: Is a workbook open? Pin
David Mujica23-Jan-12 3:40
David Mujica23-Jan-12 3:40 
GeneralRe: Is a workbook open? Pin
Fred Andres23-Jan-12 5:22
Fred Andres23-Jan-12 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.