In C# application I like to copy the table data from one server(SQLServer2000) to another server (SQLServer2005). I like to copy the data in single instance and delete the existing data in the SQL Server 2000 table. I need to do all this(Bulk copying and Deleting) in single transaction. How to achieve this?
Note: I am having two differe...
Hi, I want to use the DBServerSyncProvider's SelectClientIdCommand but i don't wan't to add more tables to my data base, i want to specifically define the clients id (as a long), something like this:
long ClientIdentifier=540;
SqlCommand ClientIdComm = new SqlCommand();
ClientIdComm.CommandType = CommandType.Text;
ClientIdComm.Command...
If I a many-to-many relationship between Users and Roles and I have an instance of a User entity and several Role Ids can I insert a relationship between the two types of entities without having any other Role data and without doing a select on the Roles first?
Update:
I might not have been clear enough. I don't have an instance of a ...
Hi,
Does anyone know how to delete an object and all of it's related entities inside of EF without manually traversing the object graph and deleting each one?
For example, I've got SalesOrder and SalesOrderDetails with a 1:N relationship between them. When I delete a SalesOrder, I want all SalesOrderDetails to be deleted automatically....
Hi
Use the DataKeyNames property to specify the field or fields that represent the primary key of the data source. You must set the DataKeyNames property in order for the automatic update and delete features of the GridView control to work.
a) According to above quote Update should only be possible if DataKeyNames is set, and yet I...
hi
1) If you are using ConflictOptions.OverwriteChanges, then you also need to set GridView.DataKeyNames, else GridView won’t pass these parameters to the SqlDataSource and thus the Delete operation won’t succeed.
But if you’re using ConflictOptions.CompareAllValues, then DataKeyNames doesn’t have to be set. Why?
2) But why nee...
I am loading my ADO.net dataset in by select query in command object. If I clear the dataset data with Acceptchanges will it delete the data in the sql server.
If not Please let me Know how to do?
...
I'm trying to get the data that has been successfully input into the database via ADO.NET transaction.
Once you've called trans.Commit() there doesn't seem to be a way of getting back the data that has been committed since all identity columns that were created during the transaction are 'virtual' since it is an offline dataset until co...
I am using Two SQL Server connection object in my C# console application project. I need to do this in single transaction So I used Transactionscope (Distributed Transaction)
I am not able to use the connection within the transactionscope It is displaying the error
MSDTC on server is unavailable.
How can I solve.... Both the one sql...
I'm looking for an ADO.net 2.0 or later provider for Sybase database which seems to be known as Sybase ASE. To clarify, I'm interested in ASE, and not SQL Anywhere. Hopefully the provider will be included with the database, or free.
I can find mention of an ADO.net 1.1 provider; that's not what I want.
I can find mention of ODBC driver...
I am wraping some SQL Stored Procs with in/out parameters. This of course means I have to do ugly stuff like declare my parameters as by reference and use mutables.
How would I do this in F#?
...
I'm getting more and more frustrated with EF...
I have a table called ExtendedField with:
Record
DocRef
DocType
Name
Record is the primary key
DocRef and DocType are foreign keys used to identify which Ticket they belong to
Name is the key used by the "definition" table to define what the field actually is
So basically I need 2 ...
I'm working on a WinForm application that has several queries that bring back approx 20000 records and then fills a DataTable, and binds that DataTable to a DataGridView.
I want to allow the users to page through the grid 500 records at a time. What is the best way to do this? I want to do the paging on the client side. I see that the S...
hi guys,
I have to increase timeout period.Following is my code.
Private Function GetConnectionInstance() As SqlConnection
Dim objConn As SqlConnection
Dim strConnection As String
strConnection = ConfigurationSettings.AppSettings("conn")
Try
objConn = New SqlConnection(strConnection)
Catch ex As Exception
...
Hi,
I need to determine the version of SQL Server (2000, 2005 or 2008 in this particular case) that a connection string connects a C# console application (.NET 2.0). Can anyone provide any guidance on this?
Thanks, MagicAndi
Update
I would like to be able to determine the SQL Server version form the ADO.NET connection object if poss...
I have a bit of a strange one happening. The first query I got from running a profiler on a C# ADO.NET application. What it is doing is not as interesting as the way the parameters are being passed - This query is taking 250+ seconds to complete, but when I modify it (Query 1) by changing the way the parameters are passed (see Query 2), ...
What is the right way to avoid errors on INSERT and UPDATES with a SqlDataAdapter/SqlCommandbuilder when the SQL Statement used to SELECT has a computed column as one of the return fields?
I get the error now that "The column Amount cannot be modified because it is either a computed column or is the result of a UNION operator".
UPDATE:...
I am just using select query and filling the dataset. and do some changes and I want to delete this entry in the dataset I am doing this
foreach (DataRow dr in dsDatadata.Tables[0].Rows)
{
dr.Delete();
}
...
I know there have been numerous questions here about inline sql vs stored procedures...
I don't want to start another one like that! This one is about inline (or dynamic) sql.
I also know this point has become more or less moot with Linq to SQL and its successor Entity Framework.
But... suppose you have chosen (or are required by your...
I need to delete all the rows in a datatable (ADO.net). I dont want to use Foreach here.
In one single how can I delete all the rows.
Then I need to update the datatable to database.
Note: I have tried dataset.tables[0].rows.clear and dataset.clear but both are not working
Also I dont want to use sql delete query.
Post other than th...