ado.net

TableAdapter auto generate update for view

Why TableAdapter does not generate update, delete, insert code for the view ? When I add TableAdapter from view "create method to send updates directly to the database" is disabled. Is there any way to enable it? ...

how to handel XML datatype in Datatable while inserting Data through SqlBulkCopy for sql server?

In my application i want to insert XML document in to my table which has a column with XML datatype. Now issue comes when i use SqlBulkCopy in my application. i have to pass a Datatable to SqlBulkCopy.WriteToServer method. it is showing me InvalidCastException. for storing XML data in datatable, I tried to utilize Datatype property of Da...

Ado.net - the Size property has an invalid size of 0

Hello. I'm trying to get output value from DB via ADO.net. There's a client code: using (var connection = new SqlConnection(ConnectionString)) { connection.Open(); SqlCommand command = new SqlCommand("pDoSomethingParamsRes", connection); command.CommandType = CommandType.StoredProcedure; command...

How does SqlConnection manages IsolationLevel?

This MSDN article states that: An isolation level has connection-wide scope, and once set for a connection with the SET TRANSACTION ISOLATION LEVEL statement, it remains in effect until the connection is closed or another isolation level is set. When a connection is closed and returned to the pool, the isolation level...

Alternates to the Oracle .net data provider?

The oracle .net client is a big pain to install and manage. So what experience have people got with alternatives? (Telling the customer that you only support Sql Server is not always an option) ...

How do I list the table names in a database?

Hi, We have an Oracle 8i database on which I have only read access. We use ODBC and MS Access to read data from that database since we don't have Oracle Client software. This works fine. I am using ADO.NET with ASP.NET. Now I want to display a list of all the tables that I see in MS Access via ODBC. I have tried this with ODBC connectio...

ado.net combine two rows into 1.

I'm working on a project that will combine a couple of sharepoint listitemcollections. It's basically to bring together three sharepoint lists. I've already gotten my three sharepoint queries to return my proper results and im using the .GetDataTable() method to generate my objects for LINQ joins. Below is my code. I may be approachi...

System.Data.SqlClient Namespace for MySQL?

The exception says that there is a network related problem, or that the SQL server does not allow remote access, none of those are true. Can it be that I'm trying to connect a MySQL server, and not MS SQL? Thanks ...

C# Lib to query MySQL DB

Hi Guys, Is there any good nice library to query MySQL DB? I have mysql connector .net installed, and it basically gives me ado.net replaced, like MySQLCommand, MySQLAdapter etc MySqlCommand command = connection.CreateCommand (); command.CommandText = "select * from samples"; but you have to write a lot of code anyway, is there any l...

Getting NHibernate session to see uncommited, external ADO.NET changes within TransactionScope

I have some code that does something like this: public void DoDatabaseWork() { _repositoryIDontControl.SaveSomeStuff(objectThatNeedsStuff.Stuff); using (var session = ... ) { session.Save(objectThatNeedsStuff); } } The crux here is that within my NHibernate mapped data model I have an object that references anothe...

What is difference in adodb and oledb?

What is the difference between adodb and oledb? What is the relation between these two? Where does ado.net stands in context of adodb and oledb? ...

Does LINQ to Entities expression with inner object context instance translated into sequence of SQL client-server requests?

I have ADO.NET EF expression like: db.Table1.Select( x => new { ..., count = db.Table2.Count(y => y.ForeignKey.ID == x.ID) }) Does I understand correctly it's translated into several SQL client-server requests and may be refactored for better performance? Thank you in advance! ...

Update C# client whenever database is updated

I am using MySQL with C# / Visual Studio 2008. I need to know any method so that if one user updates the database, all the logged in users over the network, are notified that a change has been occurred. If i logged in the database through my application, at that time the serial no of the latest record in the database was 10, and then i s...

Problem filling data table with SQL adapter in ASP.NET

I have a username db table that I'm trying to connect with to compare the username/pass. Here is my code, it's not working, what am I doing wrong? DataTable dt = null; protected void btn_Click_Login(object sender, EventArgs e) { string query = string.Format("SELECT * FROM Users WHERE Username='{0}' AND Password='{1}'", txtUsername...

Transactions on iSeries using .NET provider

Hello guys, i have multiple inserts to do so i want to do them in a transaction by calling a stored procedure on the iseries. I can't get it to work, it auto commits every insert i do so i figured i would try to do a transaction with just a simple file first and then go from there. The file is productest/cepf05 and when i first did the ...

How do I get this DataSet to add my new rows and update correctly?

Hi. I'm new to C# and .NET in general, coming from a FLOSS background (mostly PHP, Python and Ruby). I have used the Data Source configuration wizard to connect to an MDB file (unfortunately need to do this, as the app this is being used with was written over 5 years ago, and is currently a VB6 app connecting to an Access database). The ...

Entity Framework 4 Code Genning - One Set of Entities?

Hello, I am looking to setup architecture for entity framework that will break apart the entities into multiple models. What I am wondering if it is possible to code-generate one set of entities, so that each model uses the same set of data access classes? I realize the issue with contexts, but I was wondering if each context really n...

VB.net and SQL Question

I've just started to learn VB.Net and SQL. Now I'm creating my first software but I have a problem: I have two tables in my database and I managed to transfer data from table1 to table2. How can I just insert specific rows from table1 to table2. I don't want to copy all the data in table1 to table2; I just want to copy the selected rows....

SQL proc executes but nothing is inserted into the table

I have a vb.net app using plain old ado.net to run a s'proc on the database server. The proc simply inserts a record that contains binary data. When this executes, I can see the exec call on the proc being made from within sql profiler. ado.net claims everything worked, no errors. However, a record isn't inserted. There are no key c...

ASP.NET for a basic browser game

beginner programmer - basic C#, first year of university going too slow in terms of actually learning programming. i'm looking at creating framework for a basic browser game, in the vein of urbandead and the now dead nexuswar. because i'm a student i already have visual studio 08 for free - because of this, and my experience with C#, is ...