CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

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 10: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

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.