Questions tagged [executereader]

A Microsoft .NET method that sends the `CommandText` to the `Connection` and builds a `SqlDataReader`.

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)

public SqlDataReader ExecuteReader()

Return Value

  • Type: System.Data.SqlClient.SqlDataReader
  • A SqlDataReader object.

http://msdn.microsoft.com/en-us/library/9kcbe65k(v=vs.110).aspx

128 questions
0
votes
0 answers

OBDC and ExecuteReader issues

I'm trying to do a little powerShell script, which establishes a OBDC connection using SQL Server Native Client 11.0 as Driver and retrieve some data which, in my case, is just getting the list to the database tables. ##### Start the database…
Salah Elgo
  • 85
  • 1
  • 2
  • 10
0
votes
0 answers

Error: "No value given for one or more required parameters"

Imports System.Data Imports System.Data.OleDb Public Class Form1 Dim cnnOLEDB As New OleDbConnection Dim cmdOLEDB As New OleDbCommand Dim cmdInsert As New OleDbCommand Dim cmdDelete As New OleDbCommand Dim cmdUpdate As New…
user63566
  • 53
  • 7
0
votes
0 answers

commandSelect always says no open connection

I have a problem with my c# service. I tested my program first as a console aplication and everything went fine. After I made my tests I set up a service and installed the service on my PC. In the service I want to make a query from a SQL…
Matthias
  • 9
  • 1
0
votes
1 answer

combobox doesn't return any text in vb.net

I have a function that get 3 argument , a textbox and 2 combobox and use them in the code as temp of a OleDbDataReader but I have a problem and take runtime error: No value given for one or more required parameters. Sub load_txt_code(ByVal nkala…
Ravaei
  • 8
  • 6
0
votes
3 answers

How can I make the SQL connect in a Windows Form?

I'm still working on my messenger programme, it will be more secure but I'm just testing stuff. I've got a login form which is meant to connect to the SQL database, I've set it up now with a local SQL as I was trying to get it working (it still…
owenvoke
  • 228
  • 4
  • 16
0
votes
2 answers

Indifferent behaviour when using Execute Reader in C#

I have a stored procedure it returns a name so i need to get the name in in C# so i just execute the Sp from C# and read the out put using ExecuteReader() like below using (var objCommand = new SqlCommand("SpName", objConnection)) …
Arunprasanth K V
  • 20,733
  • 8
  • 41
  • 71
0
votes
1 answer

There is already an open DataReader associated with this Connection which must be closed first?

I am facing the DataReader open connection issue in ASP.NET c# While Reading the records from MySQL database. I do not know how at first time of execution of datareader it showing me open connection. The error as below at DAL MySqlDataReader…
skt
  • 449
  • 14
  • 32
0
votes
1 answer

ExecuteReader: Connection property has not been initialized

Can you explain why I am getting this error? ExecuteReader: Connection property has not been initialized Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click Dim name =…
0
votes
3 answers

System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'User'

Baglanti.FnkBaglan(); SqlCommand KayitSorgulaUsername = new SqlCommand("SELECT Username FROM User Where Username= @Username AND Username IS NOT NULL ", Baglanti.baglan); SqlCommand KayitSorgulaMail = new SqlCommand("SELECT Mail FROM…
ygzmglkc
  • 9
  • 1
  • 1
  • 8
0
votes
1 answer

How to use DataReader from Oledb and get results in Richtextbox

Dim srch As String srch = ccode.Text conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + IO.Directory.GetCurrentDirectory + "\ptdr.accdb" cmd.Connection = conn conn.Open() Dim dsrch As…
0
votes
1 answer

Not getting all results from ExecuteReader and Read()

I am running a C# application with System.Data.SqlClient. My code is not retrieving all of the rows it should. In its simplest forms it is: class SalesDatabase() { protected SqlConnection m_database; // opened on class creation ... public…
0
votes
1 answer

How can I execute a multi Join SQL query in c#

Using IDataReader in c# to pull a list of host names from a database that correspond to a specific business unit, but can't figure out what is wrong. I am guessing that there are too many arguments in the SQL statement, or perhaps the ExecuteReader…
0
votes
2 answers

List tables involved in a sql statement before it is run?

Is it possible, in .NET, to pass a sql statement to SQL server for parsing and return the tables involved in the statement and the type of operation. So for a statement like this : select * from Table1 left outer join Table2 on…
Typo Johnson
  • 5,974
  • 6
  • 29
  • 40
0
votes
0 answers

SQL ExecuteReader() Error - VB.Net

So I'm trying to read and display all entrys from the MDB file with the status as 2 and I keep getting this error: An exception of type 'System.Data.OleDb.OleDbException' occurred in Microsoft.VisualBasic.dll but was not handled in user code When I…
the1osu
  • 23
  • 2
0
votes
1 answer

More than one session created to view data of an individual

I'm trying to make so many session in order to retrieve information of an individual for whom session is created inside my website. for now the execute scalar gives me just one value for all the labels i have assigned to different sessions created…
1 2 3
8 9