ado.net

Membership with Mysql, EF 1 and ASP.NET 3.5

Hi, I created a web application with asp.net 3.5 and ado.net entity framework WebForms 1, but have not yet succeeded in creating a memebrship and roles. When I go on ASP.NET Configuration and click the Security Tab I get the following error: Keyword not supported. Parameter name: metadata Someone has already created an application with...

ADO.NET Entity Framework with OLE DB SQLServer2000 Data Source

Same as Title. Has anyone found a way to make the ADO.NET Entity Framework work with OLE DB or ODBC data sources? Specifically, I need to work with an SqlServer2000. ...

DAL Layer : EF 4.0 or Normal Data access layer with Stored Procedure

Hello Experts, Application : I am working on one mid-large size application which will be used as a product, we need to decide on our DAL layer. Application UI is in Silverlight and DAL layer is going to be behind service layer. We are also moving ahead with domain model, so our DB tables and domain classes are not having same structur...

In ADO.NET, how do specify that a column in a DataTable is required?

In ADO.NET, how do specify that a column in a DataTable is required? ...

Remove duplicate column values from a datatable without using LINQ

Consider my datatable, Id Name MobNo 1 ac 9566643707 2 bc 9944556612 3 cc 9566643707 How to remove the row 3 which contains duplicate MobNo column value in c# without using LINQ. I have seen similar questions on SO but all the answers uses LINQ. ...

Read data from uploaded excel

Hello, I need to create an ASP.NET 2.0+ web application that allows the user to upload some excel files; the contents from these files should be saved into some SQL database. The problem is with the connection string one should use in ADO.NET. According to this entry (and few others from SO), one has to specify the physical path to the ...

ADO.NET Entity Data Model - Duplicates

How can I add a Unqiue index to a column like in SQL, so it wont allow duplicates in the column? ...

Unreachable code detected

I'm getting a "Unreachable code detected" message in Visual Studio at the point con.close() in my code below. Can you spot what I've done wrong? private int chek1(String insert) { OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=d:\\sdb.mdb"); OleDbCommand com = new OleDbCommand("select cou...

Use combobox value as query value (VC# 2k8 / ADO SQLITE)

Hi, I'm a newbie in VC# and ADO SQLITE... I'm trying to change the content of a combobox according to the value present in another one... My problem is here : SQLiteCommand cmd3 = new SQLiteCommand("select distinct(ACTION) from ACTION_LIST where CATEGORY='comboBox1.text'", conn2); What to use to do the job ? Here 'comboBox1.text' is...

ObjectDataSource Insert and Update methods error

I m developing asp.net 3.5 project. When I want to Insert with DetailsView this error occured: Error : ObjectDataSource 'ObjectDataSource2' could not find a non-generic method 'AddCity' that has parameters: CITY_NAME. <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetCityByID" UpdateMethod="UpdateCity" Inse...

Is there an ORM that can support Query Notifications?

Is there an ORM out there which easily supports SQL's query notifications, so that when one client updates some data, other clients are alerted to the fact that their data is now outdated? Ideally I'd like an ORM which manages object identity itself - that is - it refreshes already loaded objects as opposed to always creating new ones. ...

How to delete multiple rows in a DataTable?

Hi, How can I delete specific DataRows within a loop of a DataTable rows which meet a custom condition -lets say the rows having an index of even number-? (Without using LINQ) Thanks ...

What is the benefit to wrapping every sql/stored proc invocation in a transaction?

The following code executes one stored procedure. The stored procedure has only one command in it. Is there any benefit to wrapping everything in a transaction, even it only has one SQL statement in it (or one stored proc that has only one sql statement)? In the sample code below, if the delete fails, it fails. There is nothing else ...

When to use "Linq to sql"?

What are the pro's and con's of using "Linq to SQL" and core ADO.NET technology for access databases? ...

what is the best way to consume daba of a database in a silverlight RIA.

Hello everyone, I'm building a software using silverlight 4 RIA enabled. The question is I don't know what is the best way to consume data from a MS SQL SERVER. The best way of consuming data might mean the following: the code is clean the development time is quick maintenance is quick ...

using a stored procedure for login in c#

If I run a store procedure with two parameter values (admin, admin) (parameters : admin, admin) I get the following message : Session_UID User_Group_Name Sys_User_Name ------------------------------------ -------------------------------------------------- - NULLAdministratorsNTMSAdmin No rows affected. (1 row(s) returned) @...

Entity Framework EntityKey / Foreign Key problem.

Hi, I keep getting the same error: Entities in 'VlaamseOverheidMeterEntities.ObjectMeter' participate in the 'FK_ObjectMeter_Meter' relationship. 0 related 'Meter' were found. 1 'Meter' is expected. I have the following table structure: Meter 1 <- * ObjectMeter * -> 1 VO_Object It is always the same scenario: The first meter is adde...

What data structure would be the least painful DataTable replacement?

I'm storing a lot of sorted ~10 row 2 column/key value pairs in ASP.NET cache-- they're the data for dropdownlists. Right now they are all DataTables, which isn't very space efficient (the rule of thumb is 10x increase in size when data is strored in a dataset). Old Code DataTable table = dataAccess.GetDataTable(); dropDownList.Data...

How to Update database through storeProcedure without knowing parameter names?

I have one table and a stored procedure(sp). I have to update the table using the stored procedure. At present I am using sp with four parameters but in the future may increase parameter list so, how can I update tge table without knowing parameters name and parameters count from Ado.Net. Note: I don't know even single parameter name bu...

Most efficient sorting of calculation on DataTable column calculation

Lets say you have a DataTable that has columns of "id", "cost", "qty": DataTable dt = new DataTable(); dt.Columns.Add("id", typeof(int)); dt.Columns.Add("cost", typeof(double)); dt.Columns.Add("qty", typeof(int)); And it's keyed on "id": dt.PrimaryKey = new DataColumn[1] { dt.Columns["id"] }; Now what we are interested in is the co...