siddu sagar

siddu sagar

  • NA
  • 7
  • 0

Connection problem

Mar 6 2007 3:59 AM

Hi All,

I am getting connection string problem .i created one windowsApplication .In that i have placed one button and Datagrid.

when i click button it should display login details in datagrid .Actually this task i completed in one system in my comapnay.

from yesterday onwards i am using new system.i am not getting any Error but when i click but it is not displaying any thing .

Data source name i have taken from like this i opened iis ,in that one treeview with system name is there here in mysystem it is like this

"B4B-2F-323-CK26(local computer)".Pls send me solution. Earlier it was working fine with the following code.

 


Mycode is
---------

Imports System.Data.SqlClient

 

    Dim conObj As New SqlConnection
    Dim adpObj As New SqlDataAdapter
    Dim dsObj As New DataSet

 Try
            conObj = New SqlConnection("Data source=local computer;user id=sa;pwd=sa;Database=vinayaka")
            conObj.Open()
            adpObj = New SqlDataAdapter("SELECT * FROM Login", conObj)
            adpObj.Fill(dsObj, "Login")
            DataGrid1.DataSource = dsObj.Tables("Login")
        
        Catch ex As Exception
            Console.WriteLine(ex.ToString())
        End Try