473,974 Members | 13,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagrid help

I am quite new to VB.net and I am struggling with the datagrid. I want to
let the user modify data in the grid and then click the save button and this
will update the database. I guess I am having trouble understanding the
update command and the parameters. The data is coming from an SQL query on
2 tables, but I will only need to update one of them. I got the grid to
show the data but I can't get it to update. This is my SQL statement

Private Const SELECT_STRING = "SELECT equipment.eqp_d escription, as
Equipment,io_ma ster.io_number, io_master.io_pa nel_id,equipmen t.eqp_id,
io_master.equip ment_io_functio n FROM io_master Left outer join equipment on
io_master.eqp_i d = equipment.eqp_i d order by io_master.io_nu mber"

My update needs to be this:

UPDATE io_master SET equipment_io_fu nction = ? WHERE io_panel_id = ?

I'm guessing that this is right:

Dim cupdate As OdbcCommand = New OdbcCommand("UP DATE io_master SET
equipment_io_fu nction = ? WHERE io_panel_id = ?", OdbcConnection)

and then I set the odbcAdapter.upd atecommand = cUpdate

My problem is I don't quite understand the cUpdate.Paramet ers.add

Can someone help me with what I should put in there?
Nov 21 '05 #1
3 1274
Altman,

First question Windowforms or Webforms and than why are you using ODBC
instead of OleDb. ODBC will give you much more work.

Cor
Nov 21 '05 #2
it is for a window forms and we are using ODBC because it is already set up
for Crystal Reports. This means the application will not have to find out
from the user where the DB is located. Otherwise I would have used OLEDB.
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:ei******** ******@TK2MSFTN GP11.phx.gbl...
Altman,

First question Windowforms or Webforms and than why are you using ODBC
instead of OleDb. ODBC will give you much more work.

Cor

Nov 21 '05 #3
Altman,

The ODBC is not always save however I saw that there is as well an
commandbuilder for ODBC which maybe makes your live as easy as it is with
OleDb.

http://msdn.microsoft.com/library/de...classtopic.asp

Althouhg it has with OleDb as well bugs, or maybe I am wrong because while I
write this I remember me that the one who always tells that the
commandbuilder has bugs likes very much ODBC.

However maybe it will make your live much easier

Cor

"Altman" <No******@SickO fSpam.com>
..
it is for a window forms and we are using ODBC because it is already set
up for Crystal Reports. This means the application will not have to find
out from the user where the DB is located. Otherwise I would have used
OLEDB.
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:ei******** ******@TK2MSFTN GP11.phx.gbl...
Altman,

First question Windowforms or Webforms and than why are you using ODBC
instead of OleDb. ODBC will give you much more work.

Cor


Nov 21 '05 #4

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

Similar topics

3
3068
by: Stephen | last post by:
I've got a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is populated by the items in an arraylist shown in the code below. When the button is clicked I would also like the code to remove the items from the Arraylist. I've very little experience working with datagrids and arraylists so im finding this...
2
9945
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell (multi-select without modifier keys). I got that working fine, but I also wanted to keep rows selected after a sort, which I do by storing the row's id in an arraylist. The idea was to do the sort and then go back and re-select the rows with that...
3
5059
by: Ryan Liu | last post by:
Hi there, I got a NullReferenceException when delete last row in a datagrid. I had hard time to solve since it does not occur in my own code. I put a datagrid in my inherited user control, then put this control on a form. I use DataAdaptor to fill the data table and update database.
4
5373
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. Currently everything is working. I can find the updated rows/columns by parsing the posted data collection against the DataGrid DataSource. However, when there is a large amount of DataGridItems (rows) the update processing can take a while. ...
0
1719
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a single worksheet into a dataset. I successfully built a dynamic datagrid. And I did successfully bind it to the dataset. Then I added the datagrid control to a PlaceHolder. The first worksheet displays beautifully. The next step is to allow...
5
5925
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by changing the size of the form The code is at the following location in the January, 2004 help ms-help://MS.VSCC.2003/MS.MSDNQTR.2004JAN.1033/cpref/html/frlrfSystemWindowsFormsDataGridClassTopic.ht You can also find it by doing a search for...
14
1863
by: Brett Sinclair | last post by:
Hello everybody I'm still on the learning curve here...and from what I read, I created inherited datagrid class so I could have icons, combobox...etc in the columns of my datagrid. The grid will be used to populate information coming from a Webservice. (No datasets - No datareaders). So, I do not know see how to use the "datasource".
4
2150
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click gets connected to the C# code,
9
2739
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
10
2996
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C 22222 D E F 33333 G H I 44444 J K L
0
10161
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11404
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11564
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10903
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8454
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6411
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.