Problems with DataAdapter at VB.Net in a connection to SQL Server 2008 -
i´m experimenting troubles on local connection sql server 2008, it´s throwing me next especific error: network-related or instance-specific error ocurred while establishing connection sql server. server not found or not accesible. verify instance name correct , sql server configured allow remote connections (error 40) i´ve tried of solutions concerning sql services , firewall solutions, think problem specific in source code, is:
private sub cargar_combo(byval combobox combobox, byval sql string) dim strconexion string = "data source=angel-pc\sqlexpress1;initial catalog=sistemareferencias;integrated security=true" dim conexion new sqlconnection(strconexion) try conexion.open() dim cmd new sqlcommand(sql, conexion) dim da new sqldataadapter(cmd) dim ds new dataset da.fill(ds) combobox.datasource = ds.tables(0) combobox.displaymember = ds.tables(0).columns(1).caption.tostring combobox.valuemember = ds.tables(0).columns(0).caption catch ex exception messagebox.show(ex.message.tostring, "error", messageboxbuttons.ok, messageboxicon.error) if conexion.state = connectionstate.open conexion.close() end if end try end sub
i know string connection right, because used in method, error comes @ "da.fill(ds)" line, basics appreciate can provide.
go desktop. right click , add new text file, "test.txt". rename text file test.udl, warning, accept it. double click test.udl, , have interactive dialog configure connection string.
once have configured connection string. click save. right click test.udl file , open in notepad. give connection string need put app.
Comments
Post a Comment