ado.net

Theater Seating application in WPF -problems in databinding

Hello, I am new to WPF, and I want to develop an application for Theater seating in WPF- c#.net. I did some research but i am lost as i do not know how each seat's data (sold or not, price, in which row) should be eventually bound to field in a table in SQL Express. Should i be using ObservableCollection to populate the contents of a Dat...

Need to run SQL script on 5000+ databases. How should I approach?

I am developing a tool that will eventually be used to run a sql script on 5000+ production databases simultaneously. For now it will only be used to run scripts on our Dev and QA databases. But I want to design it in the most extensible way, and have no experience doing something like this, so I could use some advice. Technology I'm cu...

Code generator to create ADO.NET SqlParemeter array from stored procedure inputs?

I have SQL Server stored procedures which have several inputs. I want to save time from manually creating C# ADO.NET sqlParameter arrays as in sqlParameter[] sqlParameters = { new SqlParameter("customerID", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, string.Empty, DataRowVersion.Default, custID) ....... ...

ADO.NET: How to have N parameters?

i need to mark a batch of rows in the database as "processed". In the olden days, when things were easier, i would create some SQL that said: UPDATE Readings SET IsProcessed = 1 WHERE ReadingDateTime IN ( "2010-10-07 22:02:13.327", "2010-10-07 22:02:14.213", "2010-10-07 22:02:15.595", ... "2010-10-07 23:03:36.981")...

SQL Server truncate table - drop and recreate FK constraints script

Hello, I'm writing small application (in c#) which helps me to truncate tables in SQL Server 2005/08. In order to truncate table I think I need to do this: drop all FK constraints from table, truncate the table, recreate all previously deleted constraints. Can someone help me to create such a script, or point me where I can find so...

What is the real cost of a SQL transaction?

This requires a bit of background. I'm creating a web app (ASP.NET/VB.NET with SQL Server backend) that will accept an application to receive funding, and this form has contact info fields for three people. Because the information is the same for all three people (name, email, phone), I chose to store contact info in a table separate f...

ASP.NET Connection Pool Problem?

Hello I create SqlConnection objects in every Insert,Update,Delete and Select methods in asp.net web pages. Then i close the connection objects in finally block. But im not sure about this is a good way. Is this a problem about connection pool? Do you have any recommendations about how to use SqlConnection and SqlDataReader objects for...

How to bind multiple tables to a binding navigator using data source wizard in C#

How to bind multiple tables to a binding navigator using data source wizard in C# so that when textbox1 value changes the values in other textboxes should be change which contains data from other table. tables have foreign key relationships. ...

vb.net ADO CommandBuilder Insert ?

I'm using vb.net 2008 and ADO.NET. When using the ADO CommandBuilder and the Insert Command how can I get the newly created Key? (my Table as an Identity column and this is the key.) ...

ADO with Parent Child tables and Identity Column ?

I'm using vb.net. I have two tables - a Parent and Child. They are in DataSet/DataTables (disconnected). I Add a Parent record (in code) and a several Child record (DataGridView Bound to the Child Table - code bellow). I notice that the parent Identity is 0, and when I save it all (using the ADO Update (from the SQLCommandBuilder) the ...

How to use the poco entity generator

I'm using VS2010, and I've download the C# POCO Entity Generator installed it, now I want to use it. I can't read the toturial and I can't find any other good toturials, so I've had a go myself - I have created a model and then I'm creating new POCO Entity, but I got the bellow error: Error 1 Running transformation: System.Reflection.T...

vb.net ADO Inserting Parent + Child data?

I'm using vb.net 2008. And I am using ADO Update to Insert new data. So I have a Dataset with two tables - one a Parent and one a Child. When adding new Parent plus some child data on the client side, and then Inserting it into the DB (using TableAdapter.Update), how does the child get the new Parent ID? ...

How to manipulate a table from an Access Database with .NET

I have a table named "Streets" in an access db, and I have opened a connection with OleDbConnection con = OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;" + @"Data source=" + mdbFileName); How can I get at my table? ...

What is ADO.NET?

What is ADO.NET and what difference between it and SQL Server? ...

indexOutofRangeException occurred

Hello, I am getting 'indexOutofRangeException occurred' error - 'FixedActual' this is the code i am using any help would be appropriated. SqlDataReader dataReader = null; SqlCommand Scmd = new SqlCommand("SalesGetRecalcOrderItemCosts", this._connection); Scmd.CommandType = System.Data.CommandType.StoredProcedure; Scmd.Transaction = cu...

SqlBulkCopy from a List<>

How can I make a big insertion with SqlBulkCopy from a List<> of simple object ? Does I to implement my custom IDataReader ? ...

ADO.NET XML type column in Table Value Parameter

Hi, This isn't actually a question, it's a problem which I couldn't find any help on, so I thought I'd post the solution I eventually found in case someone else encounters it. The problem was with an XML-typed column in a TVP parameter I was passing to a SQL Server 2008 stored proc. When I called ExecuteNonQuery() I got an error that...

Entity Framework, TPT Inheritance and Multi-Language support

Hello I have this DB Structure: Service Id int PK CategoryId FK SomeOtherFields LocalizedService LocalizedServiceId PK LanguageId FK Name Description As you can see, I have a base table called Service, and a LocalizedService table in which I'm writing multilingual data, such as name and description which should be trans...

What issues surround the security of a custom server control?

I'm writing some db access server controls at the moment that take properties for things like data source and column required and whatnot. In my head I have thought about this approach and it seems to me that, in order to make these controls work you have to put them on the page and fill them full of explicit references to the database ...

How can I get to a TableAdapter for a DataTable programmatically?

Not sure if this makes sense but: I have a form with a number of TableAdapters attached (bound in VS). Depending on user selection, a DataTable is filled by one of the TableAdapters and passed to another form for display/Edit in a DataGridView. How do I then persist any changes to the DataTable back to the database? I need to identif...