I'm currently building a custom ServerSyncProvider
I've already overrided the GetServerInfo, GetSchema and GetChanges methods, but aparently I'm not getting any session parameters on the server side, like @SyncClientIdHash or @SyncLastReceivedAnchor, that should be kept on the client (I haven't done anything alteration to my SqlCeClientS...
How do you construct a DbConnection based on a provider name?
Sample provider names
System.Data.SqlClient
System.Data.OleDb
System.Data.Odbc
FirebirdSql.Data.FirebirdClient
i have connection strings stored in my IIS server's web.config file:
<connectionStrings>
<add name="development"
connectionString="Provider = IBMDA400...
Say a stored procedure on MSSQL Server uses an SQL transaction using BEGIN TRANSACTION/COMMIT TRANSACTION, how does that differ from beginning and commiting one using ADO.NET via SqlConnection.BeginTransaction()?
...
So I've got a situation where I need to pass a bunch of data to the server to create a bunch of records. So I read this article and chose the XML method. So I've got the stored procedure all created in sql server 2005. But now I need to call it from asp.net code. Only all I've got for a database connection is an odbcconnection. I se...
Hi,
I'm currently using the Microsoft ADO.NET provider for Oracle (System.Data.OracleClient). I'm aware that it is certainly not the best Oracle provider available and that it will soon be deprecated, I should be using Oracle's ODP.NET instead. The reason why I still use the MS provider is because ODP.NET binds parameters by position, n...
I've encountered a strange problem in Sql Server.
I have a pocket PC application which connects to a web service, which in turn, connects to a database and inserts lots of data. The web service opens a transaction for each pocket PC which connects to it. Everyday at 12 P.M., 15 to 20 people with different pocket PCs get connected to the ...
I have a C# database layer that with static read method that is called every second in background timer.
currently I create SqlCommand, SqlConnection once as a class memeber.
In every method call I execute the command to get the results,I am doing so to avoid creation of connection and command every second, but I am afraid from except...
I'm using Visual Studio 2008. I'm using an .xsd/tableadapters to access a SQL Server 2005 database. One of my tables has a DateTime field. When a record is inserted into the table, the time is automatically converted to the UTC time, which is fine. I just want to know where that takes place. Does SQL Server do the conversion or is .Net d...
For the last few months we've had a wierd problem with our website. Once in a while various queries to the database, using ADO.NET DataSets, will throw an error... the most common of which is "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."
The data is actually val...
hi
I'm trying to build a custom ServerSyncProvider
right now I'm trying to understand the GetScema Method
I'm trying to build a dataSet and associate it to SyncSchema class
one of my table columns is a nvarchar(50)
so im doing this:
DataColumn column = new DataColumn();
column.ColumnName = "Name";
column.DataType = ...
The environment I am using is C# 3.5, ado.net, sqlserver 2005.
using System.Data; using System.Data.SqlClient;
I am using a SqlCommand cmd.Parameters of SqlDbType.DateTime to create a record in the database.
Seconds are not being stored in the database. The field in the db is of type datetime.
Do I need to do something special to ...
Hi everyone
I have 2 tables in sql server with primary keys set to identity. They are related and work fine.
I then created a form in vb 2008 and tried inserting some values into my database the respective primary keys work but the primary key in the parent table wont show up in the child table.I did create a relationship in vb using ad...
I'm looking for a third-party Oracle Data Provider for .Net (ADO.NET) with a full support of Oracle object types (like geometries). I was foolish enough to use ODP.NET and now I'm paying the price - it's incredibly buggy and I just reached the end of the line (keep crashing IIS Pool - known issue, no resolution). I found dotConnect which...
In this case, the Visual Studio designer generates a method which takes the parameter as an int, even though the corresponding database column is specified as System.Int64.
This is the query specified in the "TableAdapter Query Configuration Wizard":
SELECT *
FROM my_table
WHERE "status_id" = ?
Again, status_id is of type System.In...
I want to batch multiple select statements to reduce round trips to the database. The code looks something like the pseudo code below. It works perfectly on SQL Server, but does not work on Oracle - Oracle complains about the sql syntax. I have had a look around and the only examples I can find of returning multiple result sets from Orac...
For example I have the following tables resulting from:
CREATE TABLE A (Id int, BId int, Number int)
CREATE TABLE B (Id int, Number decimal(10,2))
GO
INSERT INTO A VALUES(1, 3, 10)
INSERT INTO B VALUES(3, 50)
INSERT INTO A VALUES(2, 5, 20)
INSERT INTO B VALUES(5, 671.35)
GO
And I run the following query multiple times:
SELECT * FROM ...
I have an exception handler for the type SqlException and I'm looking at the SqlException.Number property of the exception to determine if a dead-lock occurred (1205). I'm currious, instead of writing SqlException.Number == 1205, is there an enum I can refer to that would produce something similar to SqlException.Number == SqlExceptionNu...
In classic ASP we had the record set object. With ADO.Net we had the datatable.
Both were simple .Net objects that could be moved around easily.
What is the equivalent for using LINQ To SQL?
Most examples show "var" being used, however, this seems completely non-oo as you can't move a var around (without a cast hack). My understandi...
How to put the first item on the DropDownList in blank ? In VB is something like, DropDownList.index[0] = "";
I did this:
string StrConn = ConfigurationManager.ConnectionStrings["connSql"].ConnectionString;
SqlConnection conn = new SqlConnection(StrConn);
conn.Open();
SqlDataReader dr;
string sql;
sql = @"Select N...
I have not worked with parameters in ADO.Net very much. I'm writing a custom .Net data provider (modeled on SqlClient), and have to implement the IsNullable property in my parameter class, which inherits from DbParameter. My data provider will not support stored procedures, so I will only be supporting Input (substitution style) parame...