tableadapter

Altering a trigger in Sql Server 2005

I need to alter a trigger in sql server 2005 and I want to do it using a table adapter and a sql statement, not a stored proc. I know I could run this in the query browser and execute it but I need to deploy it across several databases and use a table adapter in the update. Is this possible? Doing Add Query -> Update -> pasting the belo...

How do you read a byte array from a DataRow in C#?

Howdy, I have a DataSet with a DataTable that fills a single row through a TableAdapter. The TableAdapter is correctly filling a DataRow in the DataTable. I am able to pull data from the DataRow with code like this: dataFileID = (int)this.dataFileDataRow["DataFileID"]; dataFileName = (string)this.dataFileDataRow["DataFileName"];...

C# Table Adapter Update Not Working

I am trying to serialize an object to a sql compact database. I am using VCS Express 2008. Every time I run a test to see if my data is sent to the database, nothing is in the database. My code: string inputForDB = null; QuizCategoryTableAdapter quizCategoryAdapter = new QuizCategoryTableAdapter(); Qui...

Why is Visual Studio's table adapter query not returning the same data as the stored procedure it represents?

I'm using a table adapter in Visual Studio to make a query to a stored procedure in my SQL Server 2005 database. When I make the call via my website application it returns nothing. When I make the same call via SQL Server Manager it returns the expected data. I put a breakpoint on the call to the adapter's getData method and looked at...

Calling Oracle SP with TableAdapter very slow

I have a query that runs super fast when executed in the sql editor (oracle): 1ms. The same query (as stored procedure) when executed by a DataSet-TableAdapter takes 2 seconds. I'm just retrieving 20rows. Since I'm using a TableAdapter, the return values are stored in a ref cursor. If I was fetching 2'000 rows I could understand that ...

How can I add non-column specific parameters to a C# table adapter?

I'm using a TableAdapter for the first time and adding a custom query to it, and I'm getting stuck on adding some search parameters to my query, here's what I've got: SELECT * FROM Orders WHERE (id_order = @id_order) OR (IsFor LIKE '%@word1%') OR (IsFor LIKE '%@word2%') OR (IsFrom LIKE '%@word1%') OR ...

Last inserted record ID problems using typed DataSet and DataGridView

Hi. I'm using following for a simple database application: SQL Server Compact Edition .sdf file as database, with int primary key IDs. Typed DataSet and BindingSource as data access layer DataGridView for displaying data. My problem is, I'm having trouble with the last inserted record/row ID. When I add a row to datagridview, using A...

How do you filter a TableAdapter's FillBy based on two tables?

I'm using VS2008 C# Express and the Northwind database on a Windows Form application. I used drag and drop to set up the master details binding (I used the Orders and Order Details) for the two datagridviews. At this point, everything works as expected. So as not to return every row in the table, I want to filter the Orders table ba...

How do I prevent selectedValue altering when calling tableAdapter's Fill() method?

I have bound my ListBox to some data. The problem is when I call myTableAdapter.Fill(..) method, SelectedValue changes to whatever is the first item ID in the list. Although "Selected Value" in VS is not bound anywhere (see image). How do I prevent this behaviour, please? Thank you very much for helping. ...

Big difference in execution time of stored proc between Managment Studio and TableAdapter.

How could a stored procdure run in 10 seconds via Management Studio, but take 15 minutes via a TableAdapter for the same inputs? It is repeatable, meaning I have run it at least three times in each environment, and Management Studio is consistently about 100 times faster. I'm using .net 2.0 and SQL Server 2000 In SQL Server Management...

How to add a property to a Table Adapter that can be bound to?

I have a database table TravelRequest that contains, amongst other things, the fields SignOffName and SignOffDate. I have a table adapter TravelRequestTable based on this table. I have a DetailsView control which uses this via an ObjectDataSource. Should be all fairly standard stuff. What I want to do is add a property called SignOffNam...

What's the best way to write "nulls" to SQL database when presenting options in combobox?

Hi Guys, I'm writing a front end to a database, presenting options as comboboxes. And I need to be able to return nulls to the database. I have a solution at the moment which involves 'fudging' a record into the query to populate the Datatable, then detecting the selection and hard coding null into my update statement if this item has...

TableAdapter - updating without a key

Hi, I'm a total newbie at the .net c# business and dove in this last week creating a form application to shuffle data around for SSIS configurations. The geniuses at MS decided not to apply a key to the table I'm working with - and generating a composite key of the two candidate fields will not work due to their combined length being t...

TableAdapter error only during high traffic

I'm working on someone else's project that makes heavy use of tableAdapters. The site works but It regular adds an entry in the Event log : "ExecuteReader requires an open and available Connection. The connection's current state is connecting. " The site doesn't throw an exception though unless there is high traffic (5+ request...

BindingSource's and DataGridView's

Hey Stackers, I have two DataGridView's bound to an underlying DataSource through BindingSources and TableAdapaters. I have two models; strings and tables. Tables -> [id, handle, description] Strings -> [id, handle, table_id] So there's a many-to-one between Tables and Strings. What's the easiest way to make the selection of the "t...

TableAdapter occasionally returning row count 1 but all null columns

I'll hit refresh on my page 20 times and it will work, then a few minutes later it stops working for 5min. The tableadapter says that it has a count of 1 but when i access a property eg : tableadapter1[0].property1 it throws an exception: [StrongTypingException: The value for column 'blogpull_keywords' in table 'blogpull' is DBNull.] b...

VB.NET: Getting DataGridView to Populate from Stored Procedure

Hi, I was just handed a VB.NET prototyping effort, and I'm not very experienced with VB.NET. I had to create a stored procedure which returns a self-referential table in order. Once, I completed that I wanted to get a DataGridView to show the results. Previously, my team has been doing a lot of this via the GUI designer of VB.NET so I...

ADO.NET TableAdapter parameters

I have a query that I wish to run through an ASP.NET TableAdapter that contains an 'IN' clause which is to receive it's values through a parameter. My question is, how do I specify this parameter? I thought of writing the conditional statement like this: AND b.group_category_id in (@ParamList) where the @ParamList is a String of the ...

Forms Databinding - DataSet not updating?

I have a Form (Compact Framework, actually) with a few fields, a date and a string, among other things. Both TextBox controls are bound to properties in a BindindSource. The BindindSource has a DataSet as its DataSource property, and the DataMember is a table in a SQL CE database. When I want to add a new row, I call bindingSource.AddN...

Same TableAdapter, Different DB

Hi, having to work in two parallel environments, developement and production, I want to use the same TableAdapter to connect to different databases (two Oracle databases running on different servers) with the very same structure. How is this possible? Thanks. ...