Question read from SQL

ofek149

Member
Joined
Sep 8, 2012
Messages
7
Programming Experience
3-5
hello :-)
how can i read information from Column Name...
i mean

DataBase Name>>Tables>>"Table Name">> and the Column name i want...
and then i want the column name to put on the text box.... so then i can change him every time...!!

i use this code

VB.NET:
Expand Collapse Copy
Imports System.Data.SqlClient

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim connetionString As String
        Dim cnn As SqlConnection

        connetionString = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
        cnn = New SqlConnection(connetionString)

        Try
            cnn.Open()
            MsgBox("Connection Open ! ")
            cnn.Close()
        Catch ex As Exception
            MsgBox("Can not open connection ! ")
        End Try
    End Sub
End Class

but this is just for connection..!!
please help..!
good day..
 
Last edited by a moderator:
Firstly, I have edited your code to make it readable. Please ensure that code snippets are readable in future.

As for the question, are you saying that you want to list the table and/or column names so that the user can select which ones they want?
 
Firstly, I have edited your code to make it readable. Please ensure that code snippets are readable in future.

As for the question, are you saying that you want to list the table and/or column names so that the user can select which ones they want?

look i have textbox1.text...
i want to read from the textbox1.text value from sql column...
 
no..!

look i build program..

Level:_______

Level=label

______=the value from SQL

Hi,

I fully support jmcilhinney's questions and in addition to that, What on earth does your last post mean?

Please do remember that being polite and respectful when asking for help will always get you a long way in life whereas being disrespectful will get you nowhere.

I suggest that you take some time to think about what you are trying to do and then explain as clearly as you can what you need us to help you with. That way, you should get the answer you are looking for.

Good luck and cheers,

Ian
 
Back
Top