executereader

ExecuteReader CommandText property has not been properly initialized

孤者浪人 提交于 2019-12-04 04:56:08
问题 First of all sorry if some of the code isn't right. I'm still new to using sql on vb.net I have the following code: Imports MySql.Data.MySqlClient Imports System.Data.SqlClient Public Class Form1 Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click Dim objConn As MySqlConnection Dim objDataset As New DataSet Dim objDataAdapter As MySqlDataAdapter Dim myCommand As MySqlCommand Dim sqlConn As String objConn = New MySqlConnection("server

SqlDataReader hangs on GetValue() method and SNIReadSyncOverAsync

寵の児 提交于 2019-12-02 11:34:16
问题 We have an extremely weird problem at hand. The .Net SqlDataReader object gets stuck while reading a value on GetValue() method. There are no exceptions and it does not timeout for at least more than 10 minutes which is really long time. After more than 10 minutes, it throws this error: General Exception - !ET:SqlException{CRLF}!M:Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.{CRLF}General Exception - !ET:Win32Exception{CRLF}

ExecuteReader CommandText property has not been properly initialized

对着背影说爱祢 提交于 2019-12-02 01:54:26
First of all sorry if some of the code isn't right. I'm still new to using sql on vb.net I have the following code: Imports MySql.Data.MySqlClient Imports System.Data.SqlClient Public Class Form1 Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad

An OLE DB Provider was not specified in the ConnectionString. 'Provider=SQLOLEDB;

做~自己de王妃 提交于 2019-11-29 14:42:12
i trying to run query using C#, i am getting the following problem An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB; my code string strConString = System.Configuration.ConfigurationManager.ConnectionStrings["WorkflowConnStr"].ConnectionString

Invalid attempt to call FieldCount when reader is closed

纵然是瞬间 提交于 2019-11-28 06:10:24
问题 The error above occurs when I try to do a dataReader.Read on the data recieved from the database. I know there are two rows in there so it isnt because no data actually exists. Could it be the CommandBehavior.CloseConnection, causing the problem? I was told you had to do this right after a ExecuteReader? Is this correct? try { _connection.Open(); using (_connection) { SqlCommand command = new SqlCommand("SELECT * FROM Structure", _connection); SqlDataReader dataReader = command.ExecuteReader

SqlCommand INSERT INTO query does not execute

╄→尐↘猪︶ㄣ 提交于 2019-11-26 23:43:38
问题 Hello guys I have got this code: SqlCommand scom = new SqlCommand( "INSERT INTO klient(name,surname) values(@kname,@ksurname)", conn); scom.Parameters.AddWithValue("@kname", kname.Text); scom.Parameters.AddWithValue("@ksurname", ksurname.Text); conn.Open(); DataTable dt = new DataTable(); SqlDataAdapter SDA = new SqlDataAdapter("SELECT * FROM klient", spojeni); SDA.Fill(dt); conn.Close(); It should insert data from textboxes: kname, ksurname, but it closes the form without showing them in MS

工具导航Map

JSON相关