tableadapter

Multiple Connection Types for one Designer Generated TableAdapter

I have a Windows Forms application with a DataSet (.xsd) that is currently set to connect to a Sql Ce database. Compact Edition is being used so the users can use this application in the field without an internet connection, and then sync their data at day's end. I have been given a new project to create a supplemental web interface for...

asp.net InsertCommand to return latest insert ID

Dear all, I'm unable to retrieve the latest inserted id from my SQL Server 2000 db using a typed dataset in asp.NET I have created a tableadapter and I ticked the "Refresh datatable" and "Generate Insert, Update and Delete statements". This auto-generates the Fill and GetData methods, and the Insert, Update, Select and Delete statement...

tableadapter VB.net 2008 - retrieve identity

Hello, I am inserting a record to a MSSQL table using a tableadapter using something like: Dim da_mytable As New t_mytableTableAdapter da_mytable.Insert(xxxx,xxxx,xxxx) The SQL table has an identity field which is also the PK for the table. The insert works fine, but my question is how to return the ID that was used on the insert. Th...

Using DataGridView to Update Multiple Tables

On a VB.NET 2008 form I have a DataGridView, BindingSource and TableAdapter. The BindingSource DataSource is a dataset. In the dataset I have a Fill command that joins three tables and this is displayed without a problem in the DataGridView. However, I am unable to Update the dataGridView because it has multiple tables from a single T...

Limit rows returned using TableAdapter (typed DataSets)

Does anyone know the best way to limit the number of rows returned when using typed TableAdapters? Options appear to be: Pass "top X" as a parameter (can't do this until we're on SQLS2008 Issue a dynamic SQL statement: set rowcount X before calling my tableadapter method, then set rowcount 0 aftwards. Something else I haven't thought ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is there any issue when using TransactionScope with Tableadapters? I have read this article and read some issues with this, but the article wa...

C# Update and Delete row table using tableAdapter, mdb access, dataGridView

I have a DataGridView, which loads data from mdb Access table The grid only shows data (is readonly). I have a button for inserting new row, and now have to make two more buttons, one for update and one for delete The following code works fine for inserting a new row this.estacionamientoTableAdapter.Insert(tb1.Text, tb2.Text, tb3.Tex...

tableadapter problem between dev and production server

Hi all, I have a problem when trying to create a new sproc for a tableadapter. On my development server, Visual Studio is using my windows login; domain name/ username. When I try and create the same tableadapter sproc on our production server, Visual Studio uses "dbo" for the db connection user ID. This is what I want for both environm...

Parameterize the schema in a strongly-typed ADO.NET TableAdapter

Hey all, I'm trying to build a strongly-typed dataset in ADO.Net and am having a little trouble with one aspect of the TableAdapters. My query looks like SELECT * FROM testdict.ModuleVariable WHERE Module = ? My problem revolves around the testdict part. We use several different schemas to access our data (because of a multiplexed ...

Smarter ways to use TableAdapter with base-class, interface or partial class.

C# ADO.Net TableAdapter objects does not implement and interface nor a base class (other than Component). Anyone used TableAdapter in a Template like (GoF-) pattern? Update: I would like to solve the problem described here: Help to improve a migration program by using template (GoF), adapter (GoF) or other nice patterns. ...

C# Display Join Query in DataGridView at designTime using TableAdapter, etc.

I have a DataGridView I also have some tableAdapters (groupTableAdapter, userTableAdapter) generated from sqlserver database. I have created a JOIN query in userTableAdapter that shows users with their correspoding groupname. Of course, I've got the classic warning Visual Studio throws regarding it is not the original bla bla bla.....

Inserting Row into an Access 2003 DB using TableAdapter

I'm new to using TableAdapters and I am unsure of what is going on. Essentially, I am trying to export data from one database to another database with a different schema using a generated dataset. Everything seems to be working fine, in terms of populating the row of the target database, when I step through the code. However, when I try ...

LIKE Statement trouble

I am having some issues while using the TableAdapter and the LIKE Statement in VB 2008. I am wanting to search name using partial spellings. When I run the application nothing is returned. Here is my SQL: SELECT MEMBERS.RolodexID, MEMBERS.FirstName, MEMBERS.LastName, MEMBERS.address, MEMBERS.Address2, MEMBERS.City, MEMBERS....

Delete selected row from datagridview and update DB

Hi all... I have a datagridview and the user will select a row, then click on a Delete button. The row should then delete AND the DB needs to update using tableadapters. How can I do this? The code is in C#... This is what I have so far: private void btnDelete_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRow...

How to check a delete / upadate operation completed successfully, using stored procedure ?

Say we have stored procedure(s) performing simple operations CREATE PROCEDURE [dbo].[AddNewAuthorReturnID] ( @Author_Name VARCHAR(MAX), @Author_ID int OUTPUT ) AS SET NOCOUNT OFF; BEGIN INSERT INTO AUTHORS (@Author_Name) VALUES (@Author_Name) SET @Author_ID = SCOPE_IDENTITY() SELECT @Author_ID END in above procedure...

Tableadapter doesn't update

i'm trying to update a tableadapter. This is an my code's example. DestTableAdapter destTableAdapter = new DestTableAdapter(); MissioniDataSet.DestDataTable destDataTable = destTableAdapter.GetDataByMissioneID(MissioneID); for(int i = 0; i < destDataTable.Rows.Count; i++) { destRow = (MissioniDataSet.DestRow)destDataTable...

Remove a Parameter from DetailsView ItemUpdating

Here's the setup I have a DetailsView whose DataSource is an ObjectDataSource. The ObjectDataSource has two methods, select and update, that are stored procedures defined in a TableAdapter. The Select stored procedure takes 1 parameter--the record id--and returns the fields populated in the DetailsView. The Update stored procedure t...

.NET TableAdapter to DataAdapter

TableAdapter is a wrapper for DataAdapter. It's impossible to use TableAdapters in generic way (bacause they inherit Component class). Is it possible to get the wrapped DataAdapter out of TableAdapter? ...

SQL Query within VS TableAdapter Query Configuration Wizard

Hi, I am trying to write an SQL query within Visual Studio TableAdapter Query Wizard My SQL query is: DECLARE @SQL varchar(255); SET @SQL = ' SELECT * FROM dbAddress WHERE 1 = 1' IF @ApexLine1 = '' BEGIN SET @SQL = @SQL + ' AND addLine1 IS NULL ' END ELSE BEGIN SET @SQL = @SQL + ' AND addLine1 = ''' +...

DataSet.HasChanges is true even immediately after TableAdapter.Update is run

I've got some legacy dataset code which I'm updating. I'm attempting to determine if the dataset has changes to it so I can properly prompt for a save request. However myDataset.HasChanges() always returns true. In my save method I've edited the code to determine when the dataset get's changes and made the code like this: 1. myBindingS...