473,593 Members | 2,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset Declaration again ... CJ listening? Anyone else

OK i have came to the conclusion that since this app will be run on multiple computers that loading a complete database and then updating on exit is a moot point. I have tried several ideas submitted, but i am unable to get one of them to work completely. Here is the code i had before i realized that when i filled the dataset in the form load procedure that it would "ruin, replace, mess up" the dataset named the same thing on the other form. Below is my Update, Add, Edit and Cancel code and an exerpt from the form load which like i say, worked fine before i realized i would have to change where i declared my datasets. Do i need to programmtically code my datasets in a module, (someone else mentioned that) and if so how? so that every time a childform is loaded or made active it has an updated set of data? and i do not have several datasets containing the same data? The way i was currently headed i would have had a trailers dataset containing all trailer info and a seperate dataset containing only trailer numbers for use in another form. I have been reading all day, and am still just about where i was earlier.
I tried this and got syntax errors.
childs form class
dim tform as mdiMainForm (whatever the type is)
tForm = me.mdiParent
me.dsWhatever.m erge (tForm.dsName1)

"PLEASE NOTE: The parts that were commented out worked great until i realized they wouldn't work... uh.. well you know what i mean.
Form Load
Private Const cblnEditing As Boolean = True
Private Const cblnNotEditing As Boolean = False
' I used to fill them this way beacuse they were created on the child form, but that doesn't work since each child form has at least 2 of these
' So I asked and was given the right idea and think i have a pretty good understanding now, but i still do not know where or how to declare my 'datasets any differently so that each form can access them and be updated when the active child changes.
odbdaTrailers.f ill(dsTrailers1 )
odbdaTrucks.fil l(dsTrucks1)
odbdaDrivers.fi ll(dsDrivers1)
.....ETC ETC ETC
End Form Load

Private Sub AddData()
' Set the menu items to indicate that a record is being edited.
Call EditState(cblnE diting)
' Add a new record.
'Worked the whole way but not since i need the portions of the same dataset across multiple forms
'Me.BindingCont ext(DsTrailers1 , "equipTrailers" ).AddNew()
End Sub

Private Sub EditData()
Call EditState(cblnE diting)
End Sub

Private Sub CancelData()
' Update the menu items to not editing.
Call EditState(cblnN otEditing)
'Me.BindingCont ext(DsTrailers1 , "EquipTrailers" ).CancelCurrent Edit()
End Sub

Private Sub UpdateData()
' Temporary DataSets to store the inserted or modified row.
Dim pdsInsertedRows , pdsModifiedRows As DataSet
' Set the menu items to editing.
Call EditState(cblnN otEditing)

' End editing on the current record.
' Me.BindingConte xt(DsTrailers1, "equiptrailers" ).EndCurrentEdi t()

' Copy the DataSets by getting added/modified records from original DataSet.
'pdsInsertedRow s = DsTrailers1.Get Changes(DataRow State.Added)
'pdsModifiedRow s = DsTrailers1.Get Changes(DataRow State.Modified)

' Check to see if there is an inserted row. If there is update DataSet.
If Not pdsInsertedRows Is Nothing Then
' odbdaTrailers.U pdate(pdsInsert edRows)
End If

' Check to see if there is a modified row. If there is update dataset
If Not pdsModifiedRows Is Nothing Then
' odbdaTrailers.U pdate(pdsModifi edRows)
End If

' Synchronize the database to dataset
' DsTrailers1.Acc eptChanges()
End Sub
Nov 20 '05 #1
2 1826
Jeff,

I do'nt think I understand what your asking here... your code is alittle vague to answer a question on it. I apologize.

You have a lot of commented out stuff that shoulnd't necessarily be commented out.
Thanks,
CJ
"Jeff Brown" <no******@thist ime.com> wrote in message news:Od******** *********@twist er.austin.rr.co m...
OK i have came to the conclusion that since this app will be run on multiple computers that loading a complete database and then updating on exit is a moot point. I have tried several ideas submitted, but i am unable to get one of them to work completely. Here is the code i had before i realized that when i filled the dataset in the form load procedure that it would "ruin, replace, mess up" the dataset named the same thing on the other form. Below is my Update, Add, Edit and Cancel code and an exerpt from the form load which like i say, worked fine before i realized i would have to change where i declared my datasets. Do i need to programmtically code my datasets in a module, (someone else mentioned that) and if so how? so that every time a childform is loaded or made active it has an updated set of data? and i do not have several datasets containing the same data? The way i was currently headed i would have had a trailers dataset containing all trailer info and a seperate dataset containing only trailer numbers for use in another form. I have been reading all day, and am still just about where i was earlier.
I tried this and got syntax errors.
childs form class
dim tform as mdiMainForm (whatever the type is)
tForm = me.mdiParent
me.dsWhatever.m erge (tForm.dsName1)

"PLEASE NOTE: The parts that were commented out worked great until i realized they wouldn't work... uh.. well you know what i mean.
Form Load
Private Const cblnEditing As Boolean = True
Private Const cblnNotEditing As Boolean = False
' I used to fill them this way beacuse they were created on the child form, but that doesn't work since each child form has at least 2 of these
' So I asked and was given the right idea and think i have a pretty good understanding now, but i still do not know where or how to declare my 'datasets any differently so that each form can access them and be updated when the active child changes.
odbdaTrailers.f ill(dsTrailers1 )
odbdaTrucks.fil l(dsTrucks1)
odbdaDrivers.fi ll(dsDrivers1)
....ETC ETC ETC
End Form Load

Private Sub AddData()
' Set the menu items to indicate that a record is being edited.
Call EditState(cblnE diting)
' Add a new record.
'Worked the whole way but not since i need the portions of the same dataset across multiple forms
'Me.BindingCont ext(DsTrailers1 , "equipTrailers" ).AddNew()
End Sub

Private Sub EditData()
Call EditState(cblnE diting)
End Sub

Private Sub CancelData()
' Update the menu items to not editing.
Call EditState(cblnN otEditing)
'Me.BindingCont ext(DsTrailers1 , "EquipTrailers" ).CancelCurrent Edit()
End Sub

Private Sub UpdateData()
' Temporary DataSets to store the inserted or modified row.
Dim pdsInsertedRows , pdsModifiedRows As DataSet
' Set the menu items to editing.
Call EditState(cblnN otEditing)

' End editing on the current record.
' Me.BindingConte xt(DsTrailers1, "equiptrailers" ).EndCurrentEdi t()

' Copy the DataSets by getting added/modified records from original DataSet.
'pdsInsertedRow s = DsTrailers1.Get Changes(DataRow State.Added)
'pdsModifiedRow s = DsTrailers1.Get Changes(DataRow State.Modified)

' Check to see if there is an inserted row. If there is update DataSet.
If Not pdsInsertedRows Is Nothing Then
' odbdaTrailers.U pdate(pdsInsert edRows)
End If

' Check to see if there is a modified row. If there is update dataset
If Not pdsModifiedRows Is Nothing Then
' odbdaTrailers.U pdate(pdsModifi edRows)
End If

' Synchronize the database to dataset
' DsTrailers1.Acc eptChanges()
End Sub
Nov 20 '05 #2
Yeah i commented it out because i had removed the ds's contained in the project and started over in order to quit getting errors(just commented it out so i wouldn't have to retype if i used the same names), I am going to get another book so that maybe if i cannot figure it out at least i will be able to ask my question correctly. If you have a Yahoo mail account you don't use i can send the whole project to you for you to take a look at and then maybe you will understand what i do not know how to ask. hehehe. Basically, dsTrailers1 gets filled on form1 and needs certain fields and then on form2 dsTrailers1 gets filled with different fields, but the problem lies in where i declare them and how to access them because when i load form1 and do something it works fine, but then if i load form2 i get an error because the dataadapter on each form redefined the dsTrailers.xsd and eliminated needed fields, maybe i should work with dataviews based on the entire "Trailer" table , hence trailers.xsd wouldn't get redifined . Gone to books a million , hehehe, give me a week and i will at least know how to ask my question if i still have one. Thanks for everyones help, sorry to seem so "leechy", but i try to contibute where i can.

Thanks,
Jeff
"CJ Taylor" <no****@blowgoa ts.com> wrote in message news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Jeff,

I do'nt think I understand what your asking here... your code is alittle vague to answer a question on it. I apologize.

You have a lot of commented out stuff that shoulnd't necessarily be commented out.
Thanks,
CJ
"Jeff Brown" <no******@thist ime.com> wrote in message news:Od******** *********@twist er.austin.rr.co m...
OK i have came to the conclusion that since this app will be run on multiple computers that loading a complete database and then updating on exit is a moot point. I have tried several ideas submitted, but i am unable to get one of them to work completely. Here is the code i had before i realized that when i filled the dataset in the form load procedure that it would "ruin, replace, mess up" the dataset named the same thing on the other form. Below is my Update, Add, Edit and Cancel code and an exerpt from the form load which like i say, worked fine before i realized i would have to change where i declared my datasets. Do i need to programmtically code my datasets in a module, (someone else mentioned that) and if so how? so that every time a childform is loaded or made active it has an updated set of data? and i do not have several datasets containing the same data? The way i was currently headed i would have had a trailers dataset containing all trailer info and a seperate dataset containing only trailer numbers for use in another form. I have been reading all day, and am still just about where i was earlier.
I tried this and got syntax errors.
childs form class
dim tform as mdiMainForm (whatever the type is)
tForm = me.mdiParent
me.dsWhatever.m erge (tForm.dsName1)

"PLEASE NOTE: The parts that were commented out worked great until i realized they wouldn't work... uh.. well you know what i mean.
Form Load
Private Const cblnEditing As Boolean = True
Private Const cblnNotEditing As Boolean = False
' I used to fill them this way beacuse they were created on the child form, but that doesn't work since each child form has at least 2 of these
' So I asked and was given the right idea and think i have a pretty good understanding now, but i still do not know where or how to declare my 'datasets any differently so that each form can access them and be updated when the active child changes.
odbdaTrailers.f ill(dsTrailers1 )
odbdaTrucks.fil l(dsTrucks1)
odbdaDrivers.fi ll(dsDrivers1)
....ETC ETC ETC
End Form Load

Private Sub AddData()
' Set the menu items to indicate that a record is being edited.
Call EditState(cblnE diting)
' Add a new record.
'Worked the whole way but not since i need the portions of the same dataset across multiple forms
'Me.BindingCont ext(DsTrailers1 , "equipTrailers" ).AddNew()
End Sub

Private Sub EditData()
Call EditState(cblnE diting)
End Sub

Private Sub CancelData()
' Update the menu items to not editing.
Call EditState(cblnN otEditing)
'Me.BindingCont ext(DsTrailers1 , "EquipTrailers" ).CancelCurrent Edit()
End Sub

Private Sub UpdateData()
' Temporary DataSets to store the inserted or modified row.
Dim pdsInsertedRows , pdsModifiedRows As DataSet
' Set the menu items to editing.
Call EditState(cblnN otEditing)

' End editing on the current record.
' Me.BindingConte xt(DsTrailers1, "equiptrailers" ).EndCurrentEdi t()

' Copy the DataSets by getting added/modified records from original DataSet.
'pdsInsertedRow s = DsTrailers1.Get Changes(DataRow State.Added)
'pdsModifiedRow s = DsTrailers1.Get Changes(DataRow State.Modified)

' Check to see if there is an inserted row. If there is update DataSet.
If Not pdsInsertedRows Is Nothing Then
' odbdaTrailers.U pdate(pdsInsert edRows)
End If

' Check to see if there is a modified row. If there is update dataset
If Not pdsModifiedRows Is Nothing Then
' odbdaTrailers.U pdate(pdsModifi edRows)
End If

' Synchronize the database to dataset
' DsTrailers1.Acc eptChanges()
End Sub
Nov 20 '05 #3

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

Similar topics

12
1684
by: Bishoy George | last post by:
I have a dataset called ds1 filled with 2 tables Employees and Customers from Northwind database. I have dropdownList called ddLastName with the following properties: ddLastName.DataSource = ds1; ddLastName.DataMember = "Employees"; ddLastName.DataTextField = "LastName"; ddLastName.DataBind(); ddLastName.Items.Insert(0,"Select:");
5
7410
by: Roy Lawson | last post by:
I am having no problems connecting to a DB, creating a DataAdapter, and creating a dataset...and connecting to the data. Using the builtin data objects to do all this. My only problem now is navigating through the data. I can get the data into a datagrid without any problems, but I want the data to show up in textboxes and use some sort of move next, move previous, move last, etc (like in VB6) command to navigate the data (using...
10
1683
by: Suzi | last post by:
I am creating a windows app and I use the data adapter wizard to generate a SQL query. Once the data adapter is created, I generate a dataset from it and my dataset appears in the designer. Then I create another data adapter from the wizard and when that is complete I try to generate the existing dataset from the new data adapter. My dataset disappears from the desinger. If a generate my dataset from data adapter 1 again then a new instance...
16
2466
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill it with incremental values e.g. if the tables looks like this: 23 56
22
25569
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet = ws.VerifySku(cartSet)
8
5087
by: GaryDean | last post by:
In an 2.0 asp app I used vs.net 2005 to create a TableAdapter:Dataset in my App_code directory. I also created a new vb class in that same directory. I have two issues: 1. I notice that there are errors in the xml code for the dataset... <TableAdapter BaseClass="system.ComponentModel.Component" DataAccessorModifier... the DataAccessorModifier is underlined as an error - if I hover over it, it says that attribute is not declared. ...
28
4301
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
8
1982
by: Harry Strybos | last post by:
Visual Studio 2005 - SP1 - VB.Net on WinXP SP2 I add a typed dataset to my solution and get the following errors : Error 1 sub 'ReadXmlSerializable' cannot be declared 'Overrides' because it does not override a sub in a base class. C:\AAProjects.Net\TRM8\TRM8.UI\Reports\BillingReport.Designer.vb 125 29 TRM8.UI Error 2 'Protected Overrides Function GetSchemaSerializable() As
4
5917
by: John Sheppard | last post by:
Hello there I was wondering if anyone could help me, I am trying to pass a typed dataset to a dialoged child form by reference. I have binding sources sitting on the child form. So to refresh them I just set their datasource. I am guessing this is probably what is causing the problem. Is there a better way to do this? Anyway this all works happily and things show up when the record already exists but I have 2 problems ; 1) When I add...
0
7871
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,...
1
7995
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
8227
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...
0
6642
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5735
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
5400
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3851
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
2379
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
1
1467
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.