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.