ado.net

passing null to DBtype.binary

hi I am using sqlparameter to insert value in to the table through procedure i have a prameter in procedure of type image in c# i set the parameter type as DbType.Binary now i want to pass Null value to the parameter if i use DBNull.value, i get incompatible data type error ...

Mono and ASP.NET Web Application Connected to MS Access

Hello: I developed an ASP.NET web application that reads an MS Access database with ADO.NET. This application will have to be run on Linux with Mono. Unfortunately, I am having problems getting Mono to work with the ADO.NET database connection. With the connection string enabled on an onLoad event, the web app will not render; howe...

How to test user's permissions to the database

I have a simple .NET 3.5 app for changing some database fields using an ODBCDataSet. Now the Feature Creep is asking if I can hide or show tabs and other controls based on the user's database permissions. Ideally, I would like to control the permissions only on the SQL Server using Windows user groups, and the app would not have any bui...

.net Provider for AQL

I am looking for a .net provider for AQL (HP OpenView), formerly known as Peregrine ServiceCenter. Is there any open source provider available? Thanks, ...

Is there a better way to do this: Convert.IsDBNull(row[somecolumn]) checking

Hi all, Is there a better way to write this code.. MyObject pymt = new MyObject(); pymt.xcol1id= Convert.IsDBNull(row["col1id"]) ? 0 : (int)row["col1id"]; pymt.xcold2id= Convert.IsDBNull(row["col2id"]) ? String.Empty : (string)row["col2id"]; pymt.xcold3id = Convert.IsDBNull(row["CustNum"]) ? 0 : (decimal)row["xcold3id"]; could this ...

C#, MySQL, ADO.NET, delimiter causing syntax error

I have C# code that cycles through .sql files and executes what's inside them to set up a database. One .sql file is basically as follows: DROP PROCEDURE IF EXISTS myProc; DELIMITER $$ CREATE PROCEDURE myProc() BEGIN -- procedure stuff goes here END $$ DELIMITER ; CALL myProc(); When I input this into the MySQL Query Browser's sc...

Populating object from datatable

I am populating the customer object as shown below. How do I write condtions as shown below in for eg. If isdbNull(.age) then .age=10 else .age=dr("age") end if Public Shared Function Retrieve() As List(Of Customer) Dim dt As DataTable = Dac.ExecuteDataTable( _ "CustomerR...

cannot use 'new' on the reference type; use 'gcnew' instead ? in VS 2005

I am using a C++ language I am getting a strange error when I am try to create a simple object of DataTable its giving error System::Data::DataTable* myDataTable = new DataTable(); even I tried this System::Data::DataTable myDataTable = new DataTable(); getting the following error please help. error C2750: 'System::Data::DataTable' :...

Inserting Rows in Relationship using a Strongly Typed DataSet

I'm using ADO.NET with a strongly typed dataset in C# (.NET 3.5). I want to insert a new row to two tables which are related in an 1:n relation. The table Attachments holds the primary key part of the relation and the table LicenseAttachments holds the foreign key part. AttachmentsDataSet.InvoiceRow invoice; // Set to a valid row, also...

Speed up LINQ inserts

Hi, I have a CSV file and I have to insert it into a SQL Server database. Is there a way to speed up the LINQ inserts? I've created a simple Repository method to save a record: public void SaveOffer(Offer offer) { Offer dbOffer = this.db.Offers.SingleOrDefault ( o => o.offer_id == offer.offer_id); ...

Retrieving the COM class factory for component with CLSID {00000535-0000-0010-8000-00AA006D2EA4}

Hi all, Will try to ask here because didn't find any other entries for this error: I'm getting this sporadic error when the .NET appliacation running under w3wp process. The application pool configured to run as 64 bit process. I'm using PIA ADODB mostly only recordsets as data containers. Retrieving the COM class factory for compone...

c# ado.net : best way to map database fields to property

Using VS2005, .net 2.0 , C# Hi all, What is the best way to map stored proc columns to the c# object properties with out creating tight coupling. For example, I dont like to do the following DataRow row = Getmyrows(); MyObject.MyProperty1 = row["col1"]; MyObject.MyProperty2 = row["col2"]; So, when the column in stored proc gets ch...

Can I add the same DataRow to a DataTable multiple times?

If I have a DataTable and want to create a new row I first call DataTable.NewRow() which returns a DataRow. This row then has the schema of the Table, and I can set the value of each field in the row. At this point does the Table "know" about the Row, or does that only happen after I call DataTable.Rows.Add(DataRow row)? If I call D**at...

Filtering a DataGridView per column with filters visible above columns

Hi, I have a rather specific query - I want to be able to retrieve data from a database, display it in a DataGridView and allow the user to filter columns by inputting simple filter queries above each column. For example:- | Foo | Bar | Baz | ------------------------------------| Filters | > 10 | 1/...

C# Crystal Reports and XML Dataset (ADO.NET) Data typing problems

Afternoon Developers, I have a problem that's beginning to get on my wick. I have looked through google and Crystal Reports help and am still stuck for a solution. We have created an XSD complete with full information about data-types and the like. A report has been created that is linked to this XSD (using a c# class generated using M...

ASP.NET C# - Anyone know of a Good Data Access Layer Class?

I am really not lookinf foe an ORM just a really good DAL that I can use. Thanks ...

vs2005 c# .net 2.0: can I store data table result some where

This is just for debugging purpose. We have an abused stored proc that takes for ever to return resultset. Optimizing the proc is out of question at this moment. Is it possible for me to store loaded dataset result some where so I dont have to keep calling the stored proc over and over again. And I could just continue testing my .net co...

How to get the generated id from an inserted row using ExecuteScalar?

Hi, I know that in Oracle I can get the generated id (or any other column) from an inserted row as an output parameter. Ex: insert into foo values('foo','bar') returning id into :myOutputParameter Is there a way to do the same, but using ExecuteScalar instead of ExecuteNonQuery? I don't want to use output parameters or stored proced...

ADO.NET Data Service Exception Handling

I am looking for information on how people are handling business rule (and field validations) using an ADO.NET Data Service wrapped around an Entity Framework object context. I have seen numerous posts/articles/etc that seem to be fine with just throwing an exception. I would prefer to have an object that contains a set of errors with ...

How to view a DataTable while debuging

I'm just getting started using ADO.NET and DataSets and DataTables. One problem I'm having is it seems pretty hard to tell what values are in the data table when trying to debug. What are some of the easiest ways of quickly seeing what values have been saved in a DataTable? Is there someway to see the contents in Visual Studio while deb...