Questions tagged [system.data]

System.Data is a namespace of the .NET framework. It provides access to classes that represent the ADO.NET architecture.

System.Data is a namespace of the .NET framework. It provides access to classes that represent the ADO.NET architecture.

References

161 questions
1
vote
0 answers

Prepared SQL statements and IDisposable

NOTE: This is not a duplicate of What does SqlCommand.Prepare() do and when should it be used? or SQLite/C# Connection Pooling and Prepared Statement Confusion or other stack overflow questions. I am not asking whether prepared statements are…
George
  • 2,436
  • 4
  • 15
  • 30
1
vote
0 answers

How do I handle a DataColumn expression exception on single row without causing all rows to use default value?

I'm trying to use a DataTable to perform calculations on rows of data using the Expression property on DataColumns. msdn I found that if there is an exception while applying the expression to the rows, the default value will be used. That's exactly…
1
vote
1 answer

Is it possible to define a column type in DataTable at run time?

I would like to create a DataTable but I don't know the types of columns at compile time. Therefore, I would like the columns types to be decided at run-time. WHAT I'VE TRIED: First, I get some data from Excel: Type tempCheck =…
LLaP
  • 2,528
  • 4
  • 22
  • 34
1
vote
4 answers

Select Query and Update Query in same StoredProcedure

I have a stored procedure in which I'll select some rows based on a condition and I need to update the status of those rows within the same stored procedure. For e.g. Create Procedure [dbo].[myProcedure] As BEGIN BEGIN TRAN T1 SET NOCOUNT ON SELECT…
user2822362
  • 127
  • 1
  • 13
1
vote
3 answers

Error in DropDownList using ASP.NET

I have a DropDownList called (DDL) in ASP.net page, I want that DDL contains some records of a table in the data base. So I did this : DDL.DataSource = myDataReader DDL.DataBind() But it's giving me (5 records) "the number of records of the table"…
Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
1
vote
0 answers

"System.Data" Not available in Visual Studio 2013 Windows 8 Project

I have shifted my work to Windows 8 Apps development from VS 2010, I was writing a small piece of code to read from CSV file and I was storing to DataTable, When I copied that code into VS 2013 - Windows App project, For "DataTable" no namespace was…
DareDevil
  • 5,249
  • 6
  • 50
  • 88
1
vote
1 answer

how to use "Using System.Data;" on monodevelop

I'm trying to access some data on access database using Monodevelop on Ubuntu. I've tried to add using system.data; but then i'll get an error that the using system.data doesn't exists. where can i find system.data library for Monodevelop? Found…
1
vote
0 answers

CSharpCodeProvider CompilerParameters using System.Data Error

I'm using VS2010, as soon as i add that line " DataTable table= null;",an error occured here is the code: public static object GetLambdaResult(string expression) { string className = "ExecuteLambda"; string methodName =…
Sineng
  • 31
  • 3
1
vote
1 answer

Xamarin Android - How to make use of System.Data.Linq?

I am using Xamarin Android IDE to develop an android business application. I have installed Xamarin Studio version 4.0.13 build 38 and I am trying to port an old .net code library which was dealing with SQL data logic. This piece of code is making…
vijayP
  • 11,432
  • 5
  • 25
  • 40
1
vote
4 answers

How can I create two commands in one connection?

For example I want to INSERT data in database and also UPDATE another table. My code is like this SqlConnection con = new SqlConnection("**"); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandText = "INSERT Borrowbook VALUES…
1
vote
1 answer

DataTable Compute and Select methods giving wrong results

I am trying to do a conditional SUM on a DataTable column. Below code doesn't give proper results for me. var d = Convert.ToDouble(myDataTable.Compute("SUM(qty_o)", "itemmaster1_id=4636 AND batch=15789")) // returns…
1
vote
1 answer

System.Data in Mono

Has System.Data in Mono been expanded to include extra functionality? I'm attempting to make use of the SQL Parser written for Mono in Mono.Data.SqlExpressions but when all the classes in the SqlExpressions namespace have been included the project…
Opflash
  • 496
  • 1
  • 6
  • 12
1
vote
3 answers

ASP.NET MVC - System.Data.DataSet not referenced problem

Well, first of all sorry about this question it must be pretty straight forward for you guys but I'm struggling myself on it, and I need to make it work :( Well I'm trying t o use DataSet on my application and when I render it I got: The type…
zanona
  • 12,345
  • 25
  • 86
  • 141
1
vote
4 answers

Imports System.Data.SqlClient .... Imports System.Data ....?

i am using both VISUAL WEB DEVELOPER 2010 & VISUAL STUDIO 2012 EXPRESS EDITION. While writing WINDOWS FORMS APPLICATION ... i used only one statement to work with DataSet,DataTable and Datarow.It is, Imports System.Data.SqlClient But while…
Pradeep
  • 1,193
  • 6
  • 27
  • 44
1
vote
3 answers

Where should I create my DbCommand instances?

I seemingly have two choices: Make my class implement IDisposable. Create my DbCommand instances as private readonly fields, and in the constructor, add the parameters that they use. Whenever I want to write to the database, bind to these…
Domenic
  • 110,262
  • 41
  • 219
  • 271