Problems connecting to database
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 9 of 9

Thread: Problems connecting to database

Threaded View

  1. #1
    Join Date
    Oct 2012

    Problems connecting to database


    I want to become a bank , but , This line has errors: da.Fill(ds, "f12")

    Where is the problem?

    Imports System.Data
    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 strsql As String
            Dim strcon As String
            strcon = "Data Source=.;Integrated Security=True"
            Dim con As New SqlConnection(strCon)
            strsql = "select * from f12"
            Dim da As New SqlDataAdapter(strsql, con)
            Dim ds As New DataSet()
            da.Fill(ds, "f12")
            DataGrid1.DataBindings.Add(New Binding("dataource", da, "f12"))
        End Sub
    End Class
    Last edited by ali 254; September 28th, 2013 at 11:04 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center