yes. my coding as follows

 Public Function connectDB()
connStr = "Data source =KIRAN;Initial Catalog=eStaffMgm;Integrated Security=SSPI;User Id=**;Password=*******"
      connSQL = New SqlConnection(connStr)
       Return connSQL
    End Function

    My system name is Kiran and the database name is eStaffMgm
    The default instance of SQL Server 2012 is MSSQLSERVER


    The code in the module was as given above and in the Main Form Load i entered the code as follows

         'connSQL = connectDB()
        'Try
        '    connSQL.Open()
        '    daSQL = New SqlDataAdapter("select TOP 10 from BANK_DETAILS", connSQL)
        '    daSQL.Fill(dS, "BANK_DETAILS")
        '    connSQL.Close()

        'Catch ex As Exception
        '    MsgBox("error")
        '    MsgBox(ex.ToString)
        '    'connSQL.Close()
        'End Try



   Pls give me a solution for this.

Recommended Answers

All 2 Replies

Is there any error in your code? do you decalred new instance of your Dataset and DataAdapter?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.