Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
89 views

Hellow everyone, I hope someone can help me. I have a vb.net console application that started giving me headaches just recently. I have the next Code: Imports System.Data.SqlClient Dim SqlQuery = New ...
user26811754's user avatar
0 votes
1 answer
79 views

Why if in SQL Server, I have a column defined as XML type, and in .NET with SqlDataReader/SqlDataAdapter I have a string? See the example in the screenhsot, cast c1 in XML, but .NET gets a string. I ...
elle0087's user avatar
  • 922
0 votes
0 answers
69 views

I have multiple tables for separate classes and want to print their data using a single method. My code so far. In the while (reader.Read()) loop the program doesnt enter the if statements (reader....
Emil Uppenberg's user avatar
0 votes
2 answers
469 views

I have a utility class with SQLDataAdapter reading data. Problem is when I try to return data from a SP using DataAdapter.fill, it almost takes around 1min,16 seconds to do the Fill operation and ...
Shalini Raj's user avatar
0 votes
0 answers
30 views

I have this model: public class Model { public IdentityUser UserId { get; set; } public string data { get; set; } public decimal data2 { get; set; } public DateTime data3 { get; ...
leonard staniloiu's user avatar
0 votes
0 answers
60 views

I'm currently hitting out of memory errors with the code shown here, and I want to move my SqlDataReader to SequentialAccess to see if that helps. I originally stumbled across this via the following ...
windowsgm's user avatar
  • 1,616
-2 votes
1 answer
110 views

I have a database that has file data stored in an image column. I need to be able to extract the data in this image column and create a document on disk. I am using C# to run the queries, extract the ...
Cassfutbol's user avatar
5 votes
2 answers
133 views

I've used datareader for reading data from SQL Server. Now let us say I've 20 rows in the table. So does my ADO.NET make 20 interactions with the SQL Server to fetch the data or does it bring all the ...
Sadhe sahith Helen's user avatar
0 votes
1 answer
82 views

I have a .NET project in which I run two SQL queries that have more or less the same complexity i.e., same number of NULL checks and INNER joins. The execution of the first SqlDataReader takes much ...
Chiel's user avatar
  • 119
0 votes
1 answer
759 views

I know the usual answers for this and they don't seem to apply. We have a process that goes through data from numerous vendors and gets it into one consistent stream. We added a vendor recently that ...
user1664043's user avatar
1 vote
0 answers
50 views

so I have the same problem as many others. I have read through articles and SO questions that are similar but never clearly understood how to resolve this problem. I am using a SQLDataReader to run a ...
Phani's user avatar
  • 881
1 vote
3 answers
731 views

Using the methods of the SqlDataReader, I can get the value of a column by passing in its name. while (dr.Read()) { size = dr["size"].ToString(); name = dr["name"]....
alinz's user avatar
  • 81
1 vote
0 answers
90 views

We are converting from ASE (Sybase) to SQL Server (yay!) Unfortunately, we have a ton of SQL built into our C# code which assumes ASE's default case insensitivity. We are using ADO for both. Is there ...
Eric Brown - Cal's user avatar
0 votes
1 answer
610 views

I need to process the data from the list using SqlDataReader. To do this, I wrote a for loop in which the data for the query will be supplied and get into SqlDataReader. But after the first iteration, ...
Chārry's user avatar
  • 17
-2 votes
2 answers
977 views

I am trying to read all the records from a local sqlite file. But for some reason, the code that I am using isn't reading all records. It is reading only the second row, that too only few columns, not ...
user243724's user avatar
0 votes
0 answers
68 views

I have public SQLite database, a lot of computer can write data to that DB. Unfortunately, Datetime format in different computer is different. Sqlite can store different Datatime format Sqlite ...
Ev1337's user avatar
  • 1
0 votes
1 answer
97 views

I have the following code but it only reads the last part of the JSON value: public string GetUsersJson(long systemOrgId) { var query = @"DECLARE @OrgId bigint = @systemOrgId SELECT e....
Ogglas's user avatar
  • 71.5k
-1 votes
1 answer
706 views

Is there a way to get a dataset and a return value from a SQL Server stored procedure with just one execution of the stored procedure? Is there a way to get both in just one call? TIA Marcos Galvani ...
MarcosGalvani's user avatar
0 votes
1 answer
80 views

I have 2 select statements in a stored procedure and getting result set in a data reader. My objective is to merge the data from 2 selects into a single JSON string. I am using nested do while and at ...
Amit Kaushal's user avatar
0 votes
0 answers
57 views

I am running a relatively simple query using SqlConnection / SqlCommand / SqlDataReader. The code looks like the below. I have this inside of a function where I pass in a date to call this function, ...
Eugene's user avatar
  • 153
0 votes
0 answers
286 views

I'm suddenly experiencing issues with obtaining data from the MS SQL DB using the SQLDataReader. The problem is that it's only happening for one specific table and the exactly the same approach works ...
Martin819's user avatar
  • 545
-1 votes
1 answer
123 views

I placed my DB reader in a separate class file because I didn't want to keep rewriting it but I keep getting the error: Object reference not set to an instance of an object. db was null This is my ...
rlatmfrl's user avatar
1 vote
2 answers
1k views

I just cannot figure out what is needed to resolve the warning about the possible null reference assignment in the following case: item.UniqueId = Convert.IsDBNull(reader["UniqueID"]) ? ...
SiBrit's user avatar
  • 1,572
1 vote
1 answer
122 views

I am trying to create a login page together with a SQL Server database but when I am trying to use the SqlDataReader, I get an error System.Data.SqlClient.SqlException: 'Incorrect syntax near ',' I'...
Jeffry Vergara's user avatar
0 votes
0 answers
207 views

Summary: .NET Core 6.0, Entity Framework Core 6.0.2.0 Calling a sproc via EF's command.ExecuteReader(). If I don't include a select 0; at the top of my sproc, no results are returned. My C# code: ...
RunzWitScissors's user avatar
1 vote
1 answer
739 views

SQL Server table: CREATE TABLE [dbo].[MessageSubscribers] ( [SubscriberId] INT IDENTITY (1, 1) NOT NULL, [SubscriberCode] NVARCHAR (MAX) NULL, [SubscriberName] NVARCHAR(MAX) NOT ...
PavanKumar GVVS's user avatar
0 votes
2 answers
389 views

I am developing an app in WPF. I am trying to fetch email, extract data, save it in DB and work with it in DataGrid. To avoid saving duplicates, I have made a method for that. My problem is, that I ...
jirina's user avatar
  • 51
1 vote
1 answer
257 views

The following code snippet: using (DataTable schemaTable = reader.GetSchemaTable()) { for (int i = 0; i < reader.FieldCount; i++) { DataRow drow = schemaTable.Rows[i]; ...
Peter's user avatar
  • 393
1 vote
0 answers
73 views

I'm working on an application that uses C# to do a search like so: using (SqlCommand cmd = new SqlCommand("[dbo].[usp_Search]", commercialConn)) ...
awimley's user avatar
  • 712
1 vote
4 answers
1k views

This code is partially working. It gives me the first and second columns in the first row. But the SQL query result has 3 rows, and I want to read them too. How can I do that? Maybe my method is wrong ...
Enes Cabri's user avatar
0 votes
1 answer
947 views

We are executing a SQL script and reading the results using a SQLDataReader. This line is throwing an InvalidCastException: reader.GetGuid(1) The object being returned is a GUID as a string ("...
Ian Hannah's user avatar
2 votes
2 answers
293 views

I am writing some script to read the sql query result at Intouch environment, it's not exactly C# language but similar. I just want to get the "1" stored in my "SQLTest" variable (...
shing9301's user avatar
0 votes
1 answer
1k views

I am working on a class Library with .NET Framework 4.0. I have managed to pull a row using ADO.NET, but I'm unable to read individual values. I want the end result in class object. I have tried ...
K.Z's user avatar
  • 5,095
1 vote
1 answer
622 views

I have this class that tries to read from the sql reader using Microsoft.Data.SqlClient; using MinimalAPI.Models.ConnectUI; namespace ConnectAPI.SQL.BAL { public class ...
redoc01's user avatar
  • 2,529
1 vote
0 answers
653 views

So I have a pretty simple reader, which executes given query: connection.Open(); using (var r = command.ExecuteReader()) { while (r.Read()) ...
Kęstutis Ramulionis's user avatar
3 votes
1 answer
3k views

I'm writing a program for viewing, archiving and restoring SQL-Data. The problem occurs only in restoring and while using target framework .NET 3.5. .NET 4.0 and higher seem to have solved the issue, ...
aaronwe's user avatar
  • 33
2 votes
1 answer
478 views

I have a stored procedure which returns two resultsets. I process it like this in my production code: Rdr = Cmd.ExecuteReader(); while (Rdr.Read()) { // process first resultset } Rdr.NextResult();...
TimTheEnchanter's user avatar
-1 votes
1 answer
44 views

I transfer the data I have taken from sql to the list, but it sends 1 missing data every time, the sql command works without any problems. works incorrectly in c# If there are 10 data in sql, it pulls ...
Atakan Yildiz's user avatar
0 votes
1 answer
308 views

Here is my records like in the table below. sql query My SQL query is select Category_NM as 'Kategoriler', avg(Payment) as 'Ortalamalar' from Islem where Category_Type = 'Gider' group by ...
zeyteymen's user avatar
0 votes
0 answers
62 views

I'm looking to combine an async fill operation with disposable. class G { SqlConnection connection SqlCommand command; IAyncResult Begin(string connectionString) { this....
heyNow's user avatar
  • 884
0 votes
1 answer
1k views

I have an SQLite table that I want to get multiple columns at once. I use a query similar to this to this one to get the data from the table: "SELECT LastName, FirstName, Age, Birthday FROM ...
1Poseidon3's user avatar
0 votes
1 answer
65 views

I'm learning ADO.Net and have been performing SQL commands on GridView. Today I started to learn the SqlDataReader In ADO.Net and when I try to Execute my Command and pass it to the SqlDataReader ...
Sandarbh Asthana's user avatar
0 votes
1 answer
478 views

Currently I'm trying to combine two database tabels with a join After that I looping through the reader and create an Appointment Object foreach row that returned from the query. That Appointment ...
mariodelta's user avatar
1 vote
1 answer
140 views

I'm executing a sql script using: SqlCommand command = new SqlCommand(sqlQuery, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); if(reader.HasRows) { while(reader....
Jeff's user avatar
  • 125
0 votes
1 answer
85 views

I'm writing a Windows service. It periodically connects to a SQL database and looks for new records. I can read the SQL database without an issue and it gets the data using a SqlDataReader. I then ...
snert's user avatar
  • 15
0 votes
0 answers
206 views

private void buttonSend_Click(object sender, EventArgs e) { object functionReturnValue = null; using (System.Net.WebClient client = new System.Net.WebClient()) { ...
Do Min Joon's user avatar
0 votes
1 answer
106 views

private void button1_Click(object sender, EventArgs e) { object functionReturnValue = null; using (System.Net.WebClient client = new System.Net.WebClient()) { System.Collections....
kenluffy32's user avatar
0 votes
0 answers
716 views

Here is a code : Private Sub ComboBoxQC1L1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBoxQC1L1.SelectedIndexChanged Dim conn As New SqlConnection If conn....
Coucouyou's user avatar
5 votes
4 answers
4k views

I have a Visual Basic application where I have a connection to a MS SQL database. I have code which defines a SqlDataReader, opens the connection, and executes the ExecuteReader() command. I use the ...
Jonathan Small's user avatar
2 votes
2 answers
3k views

I'm trying read data from sql database. When I run the code, it gives an error when it comes to where it should read data. "System.InvalidCastException: Specified cast is not valid." I get ...
Erkam Şahin's user avatar

1
2 3 4 5
23