How to MS SQL Server Connection ?

haylazzz

New member
Joined
Oct 21, 2013
Messages
1
Programming Experience
3-5
Hello.

I'm using vb.net language.My Applications made Windows Form. silverlight for the first time and want to do the project.using gridview in my project. MS SQL Server to connect to the data you need to bring to the Grid.I'm as windows forms project.

Dim connectionString As String = "data source=SERVERNAME;initial catalog=DATABASE;persist security info=False;uid=sa;pwd=sapass;"
Dim sqlConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim sqltext As String


sqltext = " SELECT * FROM TBLSTSABIT"


Dim MAMULCMD As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(sqltext, sqlConnection)
Dim MAMULADP As System.Data.SqlClient.SqlDataAdapter = New System.Data.SqlClient.SqlDataAdapter(MAMULCMD)
Dim MAMUL As System.Data.DataSet = New System.Data.DataSet
MAMULADP.Fill(MAMUL, "TABLO")



datagrid.DataSource = MAMUL
datagrid.DataMember = "TABLO"
datagrid.Refresh()


But ;

silverlight application, how can I do this operation.Sorry my english is a little bad. Waiting for your help.

Thankss...
 
Dim MAMULCMD As New SqlDataAdapter("select * from TBLSTSABIT", sqlConnection)
Dim
MAMUL as new Datatable
MAMULCMD .fill(MAMUL)

datagrid.DataSource=MAMUL
 
Back
Top