ado.net Questions

12

Solved

I simplified the code a little while trying to debug: [HttpPost] public ActionResult Register(User model) { DateTime bla = new DateTime(2012, 12, 12); try { User user = new User { gid = 1,...
Fran asked 30/5, 2012 at 14:49

2

Solved

Update: As Marc noted below, my fundamental question is: What happens when Read() gets called more times than there are record sets when using QueryMultiple()? I'm working on converting an exis...
Busby asked 26/1, 2013 at 7:43

10

Solved

I am trying to write a local program management and install system for my home network, and I think I've got the technologies nailed down: C#/.NET/WPF for the client Lua for installation scriptin...
Patsy asked 28/8, 2009 at 7:18

10

Solved

What's the best way to check if a table exists in a Sql database in a database independant way? I came up with: bool exists; const string sqlStatement = @"SELECT COUNT(*) FROM my_table"; try...
Croat asked 21/1, 2009 at 8:48

5

Solved

I need to execute a custom query which will be saved somewhere in the database, and I need it to return in a DataTable, or DataSet and bind it to a GridView which will have autogenerate columns set...
Biel asked 5/6, 2012 at 13:35

6

Solved

I have the following code: const string Sql = @"select distinct [name] from tblCustomers left outer join tblCustomerInfo on tblCustomers.Id = tblCustomerInfo.CustomerId where (tblCustomer....
Scaremonger asked 20/3, 2009 at 5:58

9

In an ssis package consists of data flow task,contains OLEDB source and OLDB Target ..provider is sql native client..This used to run fine ..but now got an error as shown below.. Please tell me how...
Headachy asked 22/8, 2013 at 12:51

8

My Windows Forms application uses a strongly typed dataset created using the designer in Visual Studio. At runtime I would like to be able to select either the live or test database. What is the b...
Caracole asked 29/3, 2009 at 22:14

26

Solved

How do I view the SQL generated by entity framework ? (In my particular case I'm using the mysql provider - if it matters)
Wartime asked 11/9, 2009 at 19:33

3

Solved

I have a C# program that executes a SQL query, using the code listed below. I've been using this code for a while with no problems until the other day. I'm passing a query string to SQL that incl...
Soembawa asked 31/3, 2015 at 18:32

12

How do you check if it is open or closed I was using if (SQLOperator.SQLCONNECTION.State.Equals("Open")) however, even the State is 'Open' it fails on this check.
Curarize asked 4/8, 2011 at 15:13

12

Solved

I just installed the ADO.NET connector from here http://dev.mysql.com/downloads/connector/net/ Yet MySQL doesn't appear as a data source like it should. I tried restarting Visual Studio. It doesn'...
Fecal asked 2/6, 2013 at 3:18

3

Solved

I am using Entity Framework 5 code first. My table has a column called Active and its datatype is of type int. The values that are stored in Active are 0, 1 and null. I have a class that I need to...

4

I am using.NET Framework 4.6.1, WinForms, PostgreSQL 6.4beta4 and Npgsql and ADO.NET. My current application is a multi-user-application where all users connect to the same database. Data gets bo...
Thoreau asked 19/8, 2016 at 12:43

5

Solved

I have a dataset called "results" with several rows of data. I'd like to get this data into a string, but I can't quite figure out how to do it. I'm using the below code: string output = ""; forea...
Nazler asked 8/3, 2012 at 15:43

12

Solved

After connecting to the database, can I get the name of all the columns that were returned in my SqlDataReader?
Laundry asked 25/3, 2009 at 13:43

3

Scenario: We have a DataGridView which is attached to DataAdapter (datatable), we load the data in datatable using (adapter.fill(query, datatable)) in a separate thread (using delegate and beginInv...
Emeric asked 17/8, 2011 at 16:11

5

It seems like IDataReader.Read() is always true at least one time (If I'm wrong about this let me know.) So how do you tell if it has no records without just wrapping it in a try/catch?
Stutman asked 9/9, 2008 at 2:8

34

Solved

I am getting following error when i am trying to connect Production DB from Local Environment. I was able to connect Production DB before, but suddenly i am getting following error, any idea? A co...
Affirmatory asked 17/7, 2010 at 4:1

5

Solved

I have a stored procedure that has a parameter called UserName and in my code behind I have a SqlCommand object that I add the parameters to with the Add method. But for some reason when the comman...
Syringe asked 17/2, 2010 at 15:55

19

Solved

The strange thing is, it was working fine a few days ago. I added a new column to a table and was going to update the model through the designer and now it says "The Entity Data Model Designer is u...
Reliquiae asked 14/2, 2013 at 20:53

2

Solved

I am trying to use Ado.Net Sql command to select data from a table with a date filter. SELECT COLUMN1 , COLUMN2 FROM TABLENAME WHERE DATE_INSERTED > @[User::LastInsertDate] Both Date_Inserte...
Shanonshanta asked 9/10, 2012 at 10:41

8

Solved

SqlConnection, SqlCommand and SqlDataReader all implement the IDisposable interface. I read about a best practice to always wrap IDisposables into a using block. So, my common scenario for queryin...
Incubus asked 7/6, 2013 at 13:55

11

Solved

While using the using() {} (sic) blocks as shown below, and assuming that cmd1 does not live beyond the scope of the first using() {} block, why should the second block throw an exception with the ...
Yettayetti asked 20/10, 2011 at 14:50

2

Edit: This boils down to why does changing just SqlConnection.Open() to await SqlConnection.OpenAsync() within asynchronous code result in strongly different behavior. What's the difference betwee...
Vankirk asked 17/11, 2016 at 18:49

© 2022 - 2024 — McMap. All rights reserved.