473,398 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

TABLEADAPTER.INSERT very slow


I have a datagridview where a user enters a row of data. Upon hitting
the ENTER key, I capture that event and add additional rows based upon
business logic, and delete their original row. As this is a heads-down
data entry app, it must be very speedy and this is not. All of my
other trips back and forth to the server are quite rapid (i.e. data
validation, etc). I have tried collecting the data on the client side
and then submitting it to the server just one time, but everything else
causes an extra blank row in my datagridview. Any suggestions?
tblMMTimeCardTableAdapter.Insert(

((int)tblMMTimeCardDataGridView["tcTimeReportID",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value),

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcEmplid",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((string)tblMMTimeCardDataGridView["tcEmplid",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: null,

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcTRC",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((string)tblMMTimeCardDataGridView["tcTRC",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: null,

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcQty",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((decimal)tblMMTimeCardDataGridView["tcQty",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: 0,
0, //OVT

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcOverrideRt",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((decimal)tblMMTimeCardDataGridView["tcOverrideRt",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: 0,
//Project.Text,

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcProject",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((string)tblMMTimeCardDataGridView["tcProject",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: Project.Text,
//Activity.Text,

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcActivity",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((string)tblMMTimeCardDataGridView["tcActivity",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: Activity.Text,
strEquip,

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcCustomer",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((string)tblMMTimeCardDataGridView["tcCustomer",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: null,

SqlDBUtils.ValueOrDBNull(tblMMTimeCardDataGridView["tcJobcode",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value) != DBNull.Value
?
((string)tblMMTimeCardDataGridView["tcJobcode",
tblMMTimeCardDataGridView.CurrentCellAddress.Y].Value)
: null);

Aug 29 '06 #1
0 1917

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RobZ via DotNetMonster.com | last post by:
Hi all, I am using a tableadapter to read data from a table - no problem, I have configured the Tableadapter to add an InsertQuery. My problem is when I first Call the InsertQuery and then...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
3
by: Mike | last post by:
Dear Group, When I add a DataTable to a Typed Dataset, and a TableAdapter to the DataTable, I am able to create methods to send updates directly to the database (GenerateDBDirectMethods),...
0
by: vbnetguy | last post by:
Hopefully someone has an answer for this or maybe I am missing something. I have a stored procedure - this stored procedure is used as my main insert for a tableadapter I am doing something...
1
by: hecsan07 | last post by:
Hey I am trying to get some practice on VS 2005 TableAdapter Configuration Wizard. I wrote a Database project and include a couple of stored procedures one of which was an insert procedure. The...
1
by: gmccallum | last post by:
I would have expected to be able to find this easily, but I couldn't. I am using the TableAdapter.Insert command to insert a record. I would like to then get an ID field from that record after...
1
by: =?Utf-8?B?RGV2YW4=?= | last post by:
Hi, I have a table adapter for a database with an insert query. I want to be able to get the PRIMARY key of the inserted record for that insert statement. I know that SCOPE_IDENTITY is the...
3
by: Randy | last post by:
I think that this is a really simple question. I have a table adapter set up with the various sql queries. I'd like to allow the user to make changes to a given row on a form. Each of the...
0
by: Yin99 | last post by:
I'm using TableAdapter with .NET 2.0 and SQL 2005. In SQL Database, a column's type is "float". Default TableAdapter methods update, insert, get, etc. maps this automatically to c# type...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.