473,394 Members | 1,840 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,394 software developers and data experts.

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.merge (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.fill(dsTrailers1)
odbdaTrucks.fill(dsTrucks1)
odbdaDrivers.fill(dsDrivers1)
.....ETC ETC ETC
End Form Load

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

Private Sub EditData()
Call EditState(cblnEditing)
End Sub

Private Sub CancelData()
' Update the menu items to not editing.
Call EditState(cblnNotEditing)
'Me.BindingContext(DsTrailers1, "EquipTrailers").CancelCurrentEdit()
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(cblnNotEditing)

' End editing on the current record.
' Me.BindingContext(DsTrailers1, "equiptrailers").EndCurrentEdit()

' Copy the DataSets by getting added/modified records from original DataSet.
'pdsInsertedRows = DsTrailers1.GetChanges(DataRowState.Added)
'pdsModifiedRows = DsTrailers1.GetChanges(DataRowState.Modified)

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

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

' Synchronize the database to dataset
' DsTrailers1.AcceptChanges()
End Sub
Nov 20 '05 #1
2 1813
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******@thistime.com> wrote in message news:Od*****************@twister.austin.rr.com...
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.merge (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.fill(dsTrailers1)
odbdaTrucks.fill(dsTrucks1)
odbdaDrivers.fill(dsDrivers1)
....ETC ETC ETC
End Form Load

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

Private Sub EditData()
Call EditState(cblnEditing)
End Sub

Private Sub CancelData()
' Update the menu items to not editing.
Call EditState(cblnNotEditing)
'Me.BindingContext(DsTrailers1, "EquipTrailers").CancelCurrentEdit()
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(cblnNotEditing)

' End editing on the current record.
' Me.BindingContext(DsTrailers1, "equiptrailers").EndCurrentEdit()

' Copy the DataSets by getting added/modified records from original DataSet.
'pdsInsertedRows = DsTrailers1.GetChanges(DataRowState.Added)
'pdsModifiedRows = DsTrailers1.GetChanges(DataRowState.Modified)

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

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

' Synchronize the database to dataset
' DsTrailers1.AcceptChanges()
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****@blowgoats.com> wrote in message news:%2****************@TK2MSFTNGP11.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******@thistime.com> wrote in message news:Od*****************@twister.austin.rr.com...
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.merge (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.fill(dsTrailers1)
odbdaTrucks.fill(dsTrucks1)
odbdaDrivers.fill(dsDrivers1)
....ETC ETC ETC
End Form Load

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

Private Sub EditData()
Call EditState(cblnEditing)
End Sub

Private Sub CancelData()
' Update the menu items to not editing.
Call EditState(cblnNotEditing)
'Me.BindingContext(DsTrailers1, "EquipTrailers").CancelCurrentEdit()
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(cblnNotEditing)

' End editing on the current record.
' Me.BindingContext(DsTrailers1, "equiptrailers").EndCurrentEdit()

' Copy the DataSets by getting added/modified records from original DataSet.
'pdsInsertedRows = DsTrailers1.GetChanges(DataRowState.Added)
'pdsModifiedRows = DsTrailers1.GetChanges(DataRowState.Modified)

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

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

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

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

Similar topics

12
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 =...
5
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...
10
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...
16
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...
22
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...
8
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...
28
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
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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.