ado.net

Integer variable is acquiring a string value of "ad" somewhere along the line, can anyone see where?

Here is my code: I should get output of the department id (did) as an integer and the templatefilename (result) that is required. The errors I get are: Conversion from string "ad" to type 'Integer' is not valid. I'm fairly new to asp.net and cannot see where the did variable picks up the "ad" string. Any help would be greatly appreci...

When does it make sense to have a single transaction per multiple database connections?

Can anyone help me see in what kind of scenarios it would make sense to have one shared database transaction and multiple connections? Thanks. ...

How to convert to ADO.NET transactions rather than SQL Server Transactions?

Right now i have code that initiates transactions on SQL Server using the intended method: ExecuteNonQuery(connection, "BEGIN TRANSACTION"); try { DoABunchOnStuff(connection); DoSomeMoreStuff(connection); JustAFewMoreThings(connection); ExecuteNonQuery(connection, "COMMIT TRANSACTION"); } catch (Exception) { ExecuteNo...

Copy data from one database to another using VB.NET

I need to copy data from one database to another using a VB.NET program. The target database is SQL Server the source database is some proprietary ODBC compliant database. I need to loop through a list of table to copy. Read the data from the source database table for a given modified date. Delete the corresponding date from the target ...

ADO.net Data Services [DataWebkey]

I am using VS 2008(Professional edition) with SP1.I am new to ADO.NET DataServices.I am watching Mike Taulty videos. He used [DataWebKey] attribute to specifty the key field and he referred the namespace Microsoft.Data.Web. To follow that example I am trying to refer the same assembly,but it is not found in my system. How to fix it? ...

ADO.net Data Services - Querying

Just I started learning ADO.NET Data Services. Some Pages show the querying like (sample) http://localhost:1705/ServiceExample/SomeService.svc/Persons(1)/Name http://localhost:1705/ServiceExample/SomeService.svc/Persons(1)/Name/$value Is it XPath or XQuery? Where can i get complete rules for forming such queries with examples? Than...

Access mdb file content from .net when mdb file has password.

I am creating a window application in C# and was thinking of setting up a password on mdb file of MS-Access so that no one can open that file other than my window application or who so ever knows password of that file. I managed to make that file password protected but unfortunately I was not able to access that file through my applica...

MS-Access 07 works the same way as MS-Access 03 on different machines or need installation ?

I m creating a window application using MS-Access as my database since data volume is not large. I want to create it in accdb format i.e office 2007 then will it work with my application on any machine where there is no MS Office as mdb works on any machine. ...

what are the OleDbTypes associated with Oracle Number and varchar2 when calling a function

I'm trying to map OleDb parameters to an Oracle Function. I was able to do this using the System.Data.Oracle namespace but then found that this is depricated, so I thought i would re-write it as OldDb to avoid installing the Oracle Provider. I have defined the following oracle function as an example: create function GetImagePath (AIRS...

ADO.NET: convert a DataTable to an array of DataRows

I'm using ADO.NET and C#, and I want to convert a DataTable object into an array of DataRows. What is an elegant way of doing this? ...

LINQ2SQL to DataTable

What is the easiest way of copying a LINQ2SQL table into an ADO.NET DataTable? ...

multiple parameterized sql-statements in ado.net on SQL Server

I have a problem executing two parameterized questions in one batch using SqlCommand in ADO.NET. (I want to reduce round-trips and avoid pinging) Since I don't want execution plan pollution I expect ADO.NET to transform my CommandText from "stmt1; stmt2" with all parameters belonging to stmt1 and stmt2 added to SqlCommand.Parameters t...

How do I obtain a list of schemas that an Oracle user has access to

In Oracle I can grant privileges on my schema to another user so that the other user has access to my schema (and in turn objects in my schema). How do I programmatically ,using ADO.NET (either MS or Oracle's provider), obtain a list of schemas to which a particular user has access? ...

nHibernate safe delete

Is there any way to check if it is safe to delete record from table ? for example : daoStudent.Delete(id); doesn't throw exception if it has any child records , but I would like it to. I could take other actions like making student inactive. ...

IS there a short way to insert dataset into a new MS Access table?

I'm consuming a 3rd-party web service that outputs a Dataset (from XML). I'd like to create a new table in my local MS Access database that contains the DataSet data. Is there a simple way to hand-off the DataSet to a .net object and ask it to "create a table from this"? I know that we can use different parts of ADO to extract schem...

ADO.NET Update command with datetime parameter issue

Hi, I am trying do a database update via stored procedure using ADO.NET. Basically i setup all the parameter and command and have the one of the parameter set like the following DbParameter nm8 = provider.CreateParameter(); nm8.ParameterName = "@EDITDATE"; nm8.DbType = System.Data.DbType.DateTime; nm8.Value = aObject.ADateTime; comman...

Can't keep DataReader open and get new rows as they become available

I would like to be able to execute a query only once and keep the resulting DataReader open all the time to get new rows as they are added to the database table. Something like this: SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "select * from table"; using (SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SequentialA...

How can we filter datatable in c#?

Hi All, I have specific requirement with datatable which i am not able to get. Please help me to solve my problem. My query is as below The datatable i have with data is C1 C2 C3 C4 C5 R1 1 2 3 4 25 R2 6 7 8 24 10 R3 11 22 13 14 15 R4 16 17 23 19 20 R5 21 7 18 9 5 In output...

Reassign textbox.text on bindingsource currentitem change event

I am just learning bindingsources etc. I have added my textbox databindings like so: txtTitle.DataBindings.Add("Text", bindingNavigator1.BindingSource.Current, "Title"); When the user clicks the next button on the navigator do I have to handle the bindingsource currentitem changed event to say txtTitle.Text = ((MyObject)bindingsourc...

Cast Bindingsoure.Current to POCO

I have a sqldatareader that gets assigned to a bindingsource and a datagridview datasource to that. When I look at the type of Bindingsoure.Current its a DataRecordInternal. How can I cast that to my POCO? Will I have to manually work out which fields in the Current object relate to my POCO. I could do it through my POCO and just tak...