Línea dónde obtengo la excepción
Código:
Código completosqlDataAdapter.Fill(ds)
Código:
Muchas gracias por vuestro tiempo <WebMethod()> _ Public Shared Function DropDownList() As ArrayList Try Dim strList As New ArrayList Dim ds As New DataSet Dim cs As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("MiConexion") Dim connString As String = cs.ConnectionString Dim dbConnection As New SqlConnection(connString) Dim queryidvehiculo As String = "SELECT usuario, nombre_empresa FROM usuarios_totales WHERE usu_asoc = @user" Dim dbCommand As New SqlCommand(queryidvehiculo, dbConnection) dbCommand.Parameters.Add(New SqlParameter("@user", HttpContext.Current.Session("usuario_web"))) Dim sqlDataAdapter As New SqlDataAdapter(dbCommand) sqlDataAdapter.Fill(ds) If Not IsNothing(ds) Then Dim stringList As New List(Of String)() For Each rw In ds.Tables(0).Rows strList.Insert(rw("usuario"), rw("nombre_empresa")) Next strList.Sort() Return strList End If Catch es As Exception Dim err As String = es.ToString() Return Nothing End Try Return Nothing End Function