tableadapter

ADO.Net databinding bug - BindingSource.EndEdit() changes current position

What is the correct order of processing an insert from a data-bound control using BindingSource, DataSet, and TableAdapter? This is causing me eternal confusion. I have a form that is used to add a new row. Before showing the form, I call: bindingSource.AddNew(); bindingSource.MoveLast(); Upon Save, I call: bindingSource.EndEdit();...

TableAdapter to return ONLY selected columns? (VS2008)

(VS2008) I'm trying to configure a TableAdapter in a Typed DataSet to return only a certain subset of columns from the main schema of the table on which it is based, but it always returns the entire schema (all columns) with blank values in the columns I have omitted. The TableAdpater has the default Fill and GetData() methods that come...

Does ADO.NET TableAdapters cache stored procedure names in a super secret location

I'm guessing Visual Studio is bugging out on me. I changed the stored procedure the a TableAdapter query uses and now the users keep getting the following error. Procedure or function 'usp_GetEventNotificationSubscribers' expects parameter '@FacilityCode', which was not supplied. Nowhere in the application is 'usp_GetEventNotificationS...

How do designer-generated table adapters handle connections

Hi, How do table adapters make use of connections? To explain that a bit, do they automatically open and shut connections or if I already have the connection open before calling a tableadapter method, do they use it and leave it open? Regards ...

What happened to my TableAdapter's Update and Delete commands?

Hello - I am fighting a recalcitrant VS2008 DataSet designer, it seems. I have been trying to do what seems to be a simple 2-table dataset solution, where one table is simply the textual meaning for an integer value stored in the other table. Basic data design 101. Table1 CharField1 CharField2 IntForeignKeyField1 etc Table2 IntPrima...

Control TableAdapter Command Timeout Globally

I have a DataSet with a QueriesTableAdapter. In order to control the SqlCommand.CommandTimeout I've added a partial class called QueriesTableAdapter with a public method called ChangeTimeout. partial class QueriesTableAdapter { public void ChangeTimeout(int timeout) { foreach (System.Data.SqlClient.SqlCommand cmd in Comm...

Retrieve data from WCF to store on SQL Server CE (TableAdapter)

Hello! I have a Compact Framework 2.0 app that consume a WCF service. The data that retrieve from the service will be store on a SQL Server 2005 CE. The SQL Server CE database has his own tables. I use a TableAdapter to access SQL Server CE and Insert and Select statement to store and retrieve data. Is there a better way to do it? T...

TableAdapter's Method Keeps Resetting to NonQuery From Scalar

I'm using a .xsd file in my Visual Studio 2008 Pro solution and I'm having a problem with the ExecuteMode property of the tableadapter methods resetting. I have created a handful of insert methods in multiple adapters. I use "SELECT SCOPE_IDENTITY()" after the insert SQL to return the id of the new record. I then update the ExecuteMode p...

How to use Npgsql with TableAdapter in C#

Hi, I have PostgresQL database, and I develop interface application using C# and Npgsql to connect to the database, how can I assign the Npgsql connection to TableAdapter? Thanks, ...

Does SQL Server 2005 Automatically Convert Time Fields to UTC? Does ADO.Net?

I'm using Visual Studio 2008. I'm using an .xsd/tableadapters to access a SQL Server 2005 database. One of my tables has a DateTime field. When a record is inserted into the table, the time is automatically converted to the UTC time, which is fine. I just want to know where that takes place. Does SQL Server do the conversion or is .Net d...

TableAdapter query with an Int64 parameter over an ODBC data connection...

In this case, the Visual Studio designer generates a method which takes the parameter as an int, even though the corresponding database column is specified as System.Int64. This is the query specified in the "TableAdapter Query Configuration Wizard": SELECT * FROM my_table WHERE "status_id" = ? Again, status_id is of type System.In...

ASP.Net - TableAdapter is returning phantom results

Hi, I have a TableAdapter that is fetching rows from an Stored Procedure. For some reason, when there are no results, the TableAdapter returns an INT with value 0 instead of NULL. The SP has NOCOUNT ON. The problem with this is that I have a ListView in the frontend with an EmptyDataTemplate, which is not being shown. When I ran the qu...

Dataset times out while query runs immediately

I am running a query directly, it is trivial in nature: SELECT * FROM [dbo].[vwUnloadedJobDetailsWithData] WHERE JobId = 36963 When I run this from Management studio the query doesn't even take a second. When I run it from within the table adapter it times out. I have fixed this multiple times, but the fix is ludicrous. If I delete...

Strongly typed dataset wont fill, table mappings problem? c#.net 2.0

Hello all, You've been excellent with my other questions previously - so here I am again, in need of some help! I've got a query which joins three tables and a strongly typed dataset which has the columns defined for everything which comes back from the query. When I go to fill the dataadapter, nothing gets filled. I've copied the co...

c# and ms access database (Updating)

Good Day created Windows form application in c#, created a data source in c# from the my MS Access database 'inspro' on the form I coded for the save button: try { this.Validate(); this.entitiesBindingSource.EndEdit(); this.entitiesTableAdapter.Update(this.iNSPRODataSet.Entities); ...

Generic DataTable & TableAdaptor updates with Reflection (C#)

I have several strongly typed datasets throughout my application. Writing methods to update the data is getting tedious as each has several tables. I want to create one generic function that I can update all of the tables easily. I don't mind if I have to create one of these for each DataSet but if one function could handle all of them, ...

Why would a TableAdapter populate a DataSet with "1/1/2000" for an entire timestamp column?

I have a TableAdapter filling a DataSet, and for some reason every select query populates my timestamp column with the value 1/1/2000 for every selected row. I first verified that original values are intact on the DB side; for the most part, they are, although it seems a few rows lost their original timestamp because of update queries ...

TableAdapter.update method, where did it go?

I made a ListBox with your standard smart-control thing, and have it connected to a database. It gets the data I've pre-generated in there via query builder, so when I do this: this.calibrate_swipesTableAdapter.Fill(this.xperdex_crandallDataSet.calibrate_swipes); I get a listbox with my data. THEN, when I add a chunk of data to it, ...

How to use an MS Access parameterized stored procedure in ADO.NET?

Hi, In MS Access I have a query wich takes two parameters and I'd like to get the result of this query in a ADO.NET DataSet with a TableAdapter. In Visual Studio Express 2008 I can't select the query in the assistant. In fact it seems I can't select any queries with parameters. Is there any way to use am Access parameterized query in A...

How do you override a TableAdapter method on a Table in a DataSet?

I currently have a single DataSet declared which contains 3 tables. For sake of this example we will call them User, Question and Answer. On each of these I have a TableAdapter with the various methods required, ie. GetData(), Update(), Delete() etc. On the Answer Table I would like to override the Update Method from the TableAdapter t...