tableadapter

Getting @@IDENTITY from TableAdapter

I am trying to complete a seemingly simple task that has turned into a several hour adventure: Getting @@Identity from TableAdapter.Insert() Here's my code: protected void submitBtn_Click(object sender, EventArgs e) { AssetsDataSetTableAdapters.SitesTableAdapter sta = new AssetsDataSetTableAdapters.SitesTableAdapter(); int ins...

Table adapter query gives an error that is not reproducable in SQL Server Management Studio

I am maintaining some queries defined in the table adapters designer in Visual Studio used in some reports in a Windows Forms application (.NET 2.0). When I run the application and execute a particular query I get an error: Arithmetic overflow error converting expression to data type smallmoney. I was surprised, since the query should pr...

TableAdapter auto generate update for view

Why TableAdapter does not generate update, delete, insert code for the view ? When I add TableAdapter from view "create method to send updates directly to the database" is disabled. Is there any way to enable it? ...

.net Tableadapter to string

i get the error "DataSetSharedkey.sharedkeyDBDataTable can not converted to string Dim sharedkeyFromDB As New DataSetSharedKeyTableAdapters.sharedkeyDBTableAdapter Dim test As String = sharedkeyFromDB.GetSharedkeyByUsername(tbUserName.ToString) my GetSharedkeyByUsername Statment look like SELECT sharedKey FROM sharedkeyDB WH...

DataSet raises NoNullAllowedException even if a value is passed!

I'm writing a game server to which many players connect. I load up the DB into a DataSet(strong typed). Every time a player logs in, I add a new row to Messages table using a TableAdapter. code var newRow = _db.Messages.NewMessagesRow(); // _db is a strong-typed-dataset { newRow.Title = title; new...

iterating through the rows of a table using tableadapters in vb.net

Hi guys, i have a problem. I have database with a tableadpater. i want to get the userid with this tableadapter. Dim dsGN As New ForumTableAdapters.Message2TableAdapter Dim dtBetrieb As Data.DataTable = dsGN.GetUserIdFromThisMessage(ConversationID) For Each objRow As dsGN.Message2Row In dtBetrieb.Rows mystring = ob...

WPF and Datasets: How do I get the SQLConnection.DataSource from TableAdapterManager.Connection?

My VB WPF app is using strongly typed datasets. The connection string is set in the app.config file and is changed via the application settings designer gui. During development I connect to the test database on another server. I want a screen indicator to make it clear that the app is connected to test data. I know I could parse the co...

How to erase all records from a database when using LINQ and tableadapter?

Hi, I am trying to load data from Excel file to DataGridView in my Form. First I load all data from excel sheet into dataset then put all that data in database using C# LINQ and then I just set the DataGridView.DataSource to name.BindingSource and that is it. I get all the data in DataGridView but when I try to load the data again (I ha...

C# WinForms - how to send updates from DataGridView to DataBase

Hey, I have a .mdb file with a Customers table and an Agents table. The only thing that the Agents table does as yet is populate the Agent dropdown for each customer... I have a DataGridView linked to the customerBindingSource. The customerBindingSource has DataMember set to Customer and DataSource set to bindingSource1. This has the D...

Mysql LIMIT statement in .NET TableAdapter query

Hi, I am adding the following query to a .NET dataset TableAdapter. select * from users ORDER BY RAND() LIMIT 0,10 But the LIMIT word is not recognized as a part of the query and I am unable to proceed further. Is there any workaround for this issue? ...