Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

datagrid help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Altman - 18 Oct 2004 19:16 GMT
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?
Cor Ligthert - 19 Oct 2004 13:23 GMT
Altman,

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

Cor
Altman - 19 Oct 2004 14:10 GMT
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.

> Altman,
>
> First question Windowforms or Webforms and than why are you using ODBC
> instead of OleDb. ODBC will give you much more work.
>
> Cor
Cor Ligthert - 19 Oct 2004 14:49 GMT
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/default.asp?url=/library/en-us/cpref/html/frlr
fsystemdataodbcodbccommandbuilderclasstopic.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" <NotGiven@SickOfSpam.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
[quoted text clipped - 7 lines]
>>
>> Cor

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.