PC Review


Reply
Thread Tools Rate Thread

datagrid help

 
 
Altman
Guest
Posts: n/a
 
      18th Oct 2004
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_description, as
Equipment,io_master.io_number, io_master.io_panel_id,equipment.eqp_id,
io_master.equipment_io_function FROM io_master Left outer join equipment on
io_master.eqp_id = equipment.eqp_id order by io_master.io_number"





My update needs to be this:

UPDATE io_master SET equipment_io_function = ? WHERE io_panel_id = ?



I'm guessing that this is right:

Dim cupdate As OdbcCommand = New OdbcCommand("UPDATE io_master SET
equipment_io_function = ? WHERE io_panel_id = ?", OdbcConnection)

and then I set the odbcAdapter.updatecommand = cUpdate



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

Can someone help me with what I should put in there?


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      19th Oct 2004
Altman,

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

Cor


 
Reply With Quote
 
Altman
Guest
Posts: n/a
 
      19th Oct 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Altman,
>
> First question Windowforms or Webforms and than why are you using ODBC
> instead of OleDb. ODBC will give you much more work.
>
> Cor
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      19th Oct 2004
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" <(E-Mail Removed)>
..
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Altman,
>>
>> First question Windowforms or Webforms and than why are you using ODBC
>> instead of OleDb. ODBC will give you much more work.
>>
>> Cor
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MVVM: Single datagrid row selection when a datagrid contains anotherdatagrid in side RowDetailsTemplate Sunita@.NET Microsoft C# .NET 0 12th Nov 2010 09:03 AM
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event. Daniel Roth Microsoft Dot NET Framework 0 5th Apr 2005 04:54 AM
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls thegame Microsoft ASP .NET 1 28th Feb 2005 04:23 PM
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False Amar Microsoft ASP .NET 0 6th Apr 2004 11:14 AM
DataGrid Component | Displaying columns of a DataSet as Rows in a DataGrid ? Diego TERCERO Microsoft C# .NET 3 19th Dec 2003 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:02 AM.