Synchronize Application Objects With DataSet

Mar 14, 2012

I sometimes come across patterns or common practices that I do not agree with. I have a clear opinon of what is considered "good design", which is mainly based on my understanding of abstraction and creating layers.IMO, the core of an application is it's object model. It's a hierarchic model where one object references other objects or lists of them. That's a memory-internal model. For example, a house object references a list of rooms referencing lists of furniture.An object is identified by it's reference. There are no IDs or PKs in that layer.Saving/Loading data is an additional feature. Sure, no application will do without, but it's based on top of the core of the application. I could write an application that works very well without loading/saving, and for version 2 I will think about whether to save data to a database or an XML file. Merely this fact proves that a database layer is not the lowest. I've never agreed with that three-tier model - even if you call me unteachable.

In addition to all application objects, there are Datasets - and that's my problem now. They can be considered as a copy of what is already present in the application's object model. Its from a different, table-oriented view. As both structures exist in parallel, there's the need to synchronize the DataSet with the (rest of the) application's objects.That's the task that I am always struggling with, and I ask how you handle it. I know this is a major design question but, fortunatelly, I could quite get around this problem so far.The only solution I can imagine is maintaining additional relation lists. For example, whenever the property of a room object changes, that change must be reflected in the associated DataRow in the DataSet. For this purpose, I need a look-up table that tells me the PK of the given room in the database. It requires a lot of additional efforst to do all the synchronization.Again, the house or room object itself does not have a PK and it won't get one because on that layer, it doesn't even know that a database exists.

View 11 Replies


ADVERTISEMENT

DataSet Thread-Safety - Synchronize Read Operations?

Feb 2, 2007

I have a multi-threaded application with several datasets that are read/written to from a couple threads. I have read that datasets can handle multiple readers and one writer. I have synclocks around all dataset writes and no synchronization around reads. I am experiencing random "Index was outside the bounds of the array." exceptions where a dataset item is in a conditional statement, for example:

[Code]...

View 4 Replies

IDE :: Application Settings Will Not Synchronize

Jan 6, 2011

I'm trying to get my application to restore the default values of my application settings but every time I click the Synchronize button it says:
No user.config files were found in any of the following locations.
I have never before tried to synchronize this application and am working with Visual Studio 2010. [URL].

View 2 Replies

Asp.net - Synchronize Web Application Database With A Windows Application Database

Sep 22, 2009

I am having two databases for the same application , one in windows and the other is web based.Since web based one have few functionalities I can't opt for a single database.At the same time I want to share Both databases to be updated with other's data so as to work error free with my module of appointment fixing.

View 2 Replies

What Are The Various Objects In Dataset

Aug 18, 2010

What are the various objects in Dataset ?...

View 2 Replies

Caching DataSet Objects When Data Changed In SQL?

Oct 5, 2009

A quick question on caching dataset objects. How can I know if the data is changed in Sql when caching data? I don't want to specify time constraints but used a strategy where data is changed in sql and I have to refresh my cache?

View 1 Replies

Extension For Dataset Returning List Of Objects

Apr 6, 2010

I want to define a function similar to:[code]My current definition is having an issue with the following statement:GetList = (From x In oDS.Tables(0) Select New T(x)).ToList.I can't figure out how to get to create a New object of type T, any suggestions?

View 2 Replies

Take An Array Of Objects And Load It Into A Dataset Datatable?

Oct 16, 2010

have a lot of experience with LINQ, but should your verb be attached to the array?

data.Tables("people").LoadDataRow(parsed(int1, 1), True) S/B
data.Tables("people").LoadDataRow(person.parsed(in t1, 1), True)

View 1 Replies

Fill A DataSet On Application Startup And Use Dataset Other Form?

Jun 5, 2010

I need to pick all data in my application from my database and use it in my form

my question : how to pick all data in my application then i use it

View 3 Replies

VB Express 2008 Dataset Not Showing New Database Objects (views)

Mar 3, 2010

I am using VB Exopress 2008 and SQl Server Express 2008 in Windows Vista Home Premium. I have created a dataset after importing all tables and queries from MS Access to SQL Server. I have now added a view in SQL Server that I want to access and use in VB Express. However on clicking "Refresh" for the dataset the new view does not display in the available objects, only those I originally imported and opened with the original dataset. What, pleas am I doing wrong? How can I see this new View?

View 3 Replies

How To Synchronize Combobox With Textfield

Sep 27, 2009

[Code]....

synchronizing a combobox with a textfield. I have a form with a textfield and a combobox. The combobox is populated with the department name from the database when the form loads. I would like the textbox to display the corresponding department number when the user selects a department name from the combobox. I have tried using the SelectedIndexChanged event of the combobox but I can't seem to code it to work. This is the code I'm trying to use but it is displaying "DEPARTMENT" in the textbox. Department Code is the primary key of the table.

strSQL = "SELECT * FROM DEPARTMENT"
Dim da = New OracleDataAdapter(strSQL, cn)
da.Fill(dSet, "DEPARTMENT" )

[Code]....

View 8 Replies

Synchronize Access And Sql Server?

Aug 15, 2011

I have a small application in ms access for student information. which is on my sever.now I have same application in .net and sql server which is online in my website, while access application is on my pc...Now I want that, If i make changes in my access application, the data must be copied to my online application automatically,Same thing i want vice versa,means if i make changes in my online application, the data must be copied to my desktop database.

View 1 Replies

Synchronize Between Textbox And Listbox?

Jul 18, 2009

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If ListBox1.Text = "kg" And ListBox2.Text = "lbs" Then

[code]....

View 2 Replies

Synchronize Databases In Different Computers In A Lan?

Feb 20, 2011

I have my client app installed in many computers, each computer is connected via LAN. Each Client app uses its own SQL database. I need to synchronize the databases in each computer so that every client app has the same data. How can I achieve this using VB.net (VS 2010 , Winforms)

View 1 Replies

Two Datagridview Synchronize Column

Dec 18, 2011

I have two datagridview with same columns. When user resize the column of one of the datagridview during run time, then another datagridview column will synchronize to resize as well..

View 2 Replies

Unable To Synchronize The My.Settings?

Sep 29, 2009

With my program I wanted to change the fixed connection string to a User entered one. So in the application settings I added DBConnectionString as a user define String. If the string if empty, it shows the window where one can add the server, database and user name / password. If you press the OK button, it saves the settings:

Private Sub LDBOKBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LDBOKBtn.Click
' ----- Server name is required.
If (Trim(LDBServer.Text) = "") Then
MsgBox("The Server or Host name is required.", _

[code]....

The problem is that when you press the same button to show the System Settings again, the ConnectionString is empty again. So nothing was saved.

View 3 Replies

VS 2010 Synchronize Files?

Jul 5, 2011

I have written a stupid backup utility that copies new or modified files. That's fantastic until I come across files that are 11 GB in size that have been modified. I have a feeling I can compare the file to be backed up and the file that will be over-written (old version of file) and "synchronize" the file instead of copying the entire 11 GB.

View 6 Replies

Way To Synchronize Dragged Controls

Jan 26, 2010

How can i synchronize dragged controls (in my application), so they maintain their relative position to each other? is there some API function or .net method that can do this?

View 5 Replies

Access Objects / Properties In An Application From Another DLL

Jan 31, 2006

I have an application which is grouped in a MainApplication and serveral Modules (DLL's) The Main Application is basicly a Form with a NavigationBar on the Left Side (like in Outlook 2003) and an MDI-Parent. There is also a Simple Login Routine on this Form. I store the UserName after Loggingn to a Property. The DLL's holds functionallity and Forms for various Sections for example there is a Employee.dll which holds functions and a form to show all Employees.

On Loading of the Main Application I loop trough all dll's in a "Module"-Folder and extract NavigationItems from them which I add to the MainForms NavigationPanel. I don't have a reference to the Modules because I want to make it as flexible as possible so that it is possible to delete a Dll form the Module directory in order to remove the functionality from the MainApplication. The Modules could work also without the MainApplication if they are Complied as an exe insted of DLL of course. This works fine so far.

[Code]...

View 2 Replies

How To Release Excel Application Objects

Feb 18, 2011

I have the following code below in which I have a class with some class level Excel objects defined.When I call excelModule.Test from another class all these Excel objects are getting created and I can see an Excel instance in Task manager.

Do we have unload event for class to release these objects?
Module excelModule
Public myRange As Excel.Range

[code].....

View 2 Replies

Storing Persistent Objects In VB Application

Aug 31, 2011

point me to the best way to store persistant objects ( of my own class) in a vb application? I am putting together a simple family recipe application and have created a food item class. I would like to store the instances ( food items) indefinately so that they are there each time I start the program complete with all properties and meethods

View 14 Replies

.net - Using SyncLock To Synchronize Access To List(of T)?

Nov 16, 2010

I have a class that contains a List(of T) used in a multithreaded application. I have three methods Get, Add and Remove where these access and modify the List(of T). I was using SyncLock to lock m_List any time I queried it for the desired object as well as when I added or removed objects. However I'm curious as to if there is a performance gain by simply locking m_List when I add an object or remove an object as opposed to when I'm searching for a desired object?

[Code]...

View 1 Replies

Database - Synchronize Excel And XML Data?

Aug 19, 2009

I've got an XML file which is a pain to manually update. So I was thinking of creating a small app which synchronizes this data for me based on data from an Excel Sheet or something.

The XML schema looks like this:

<Data>
<Level1 value="Canada">
</Level1>
<Level1 value="Chile">

[code]....

View 3 Replies

Synchronize Scrolling Of Two Webbrowser Controls?

May 19, 2011

synconize scrolling of two webbrowser controls in VB?

View 2 Replies

Synchronize The Gmail Mails Using Mail.dll

Feb 16, 2011

I am using Mail.dll Commercial component. I can read the unseen or unread messages in my windows application. IF i open the mail using the [URL] then I cannot get the mail in windows application. Is there any way to synchronize the gmail mails

View 1 Replies

Form Objects Disappearing In A Running Application

Apr 21, 2010

I have a windows forms application built in VS2005 and migrated to VS2008 that I "inherited" that occasionally will not show some of the objects (i.e. a button or something) when a user runs it. This is sporadic and does not seem to have any notable pattern.Are there any specific types of things I should be looking for that might cause such behavior? I tried looking at available memory and hard disk space issues and that did not seem to have any bearing on the problem.

View 5 Replies

Publish The Application All The Shockwave Objects Are Not Shown?

Jun 24, 2010

I have an application that use in it the 'Interop.ShockwaveFlashObjects' assembly when bebugging everything works smoothly but when i publish the application all the Shockwave objects are not shown ????...what am i missing

View 9 Replies

[VB 2010] Destroying Objects And Retaining Application?

May 22, 2012

I have written a program to add a timestamp to a data sheet which had the time in seconds at which a sample was taken. The sampling was done every 0.1 seconds i.e 10 Hz sampling rate.The code I wrote enables one to select a file to which the time stamp must be added, and then runs a macro from excel when you click "Add Timestamp".

I am having a problem destroying the objects though so that they don't end up hanging around in the background. If Excel is already open I do not want it to close at the end of the program, I want Excel to simply return to its state before the application was run in order to prevent losing data on another unrelated excel task which may be open. The macro which is called closes any sheets which it opens. The other problem I am having is that if the program encounters an error there are a number of Excel objects floating in the background. My code is posted below.

Imports Microsoft.Office.Interop.Excel
Imports System.Runtime.InteropServices
Public Class Form1

[code]....

View 1 Replies

How Reliable Is LastWriteTimeUtc To Synchronize 2 Folder On 2 Different Computers

Apr 28, 2011

how reliable is LastWriteTimeUtc to synchronize 2 folder on 2 different computers? what problems could rise using LastWriteTimeUtc.is there a better way to see if a generic file is of a newwer version?

View 7 Replies

How To Synchronize Near Realtime Reads From A Sql Server Table

Sep 12, 2011

We have a reporting app thats needs to update it's charts as the data gets written to it's corresponding table. (the report is based off just one table). Currently we just keep the last read sessionid + rowid (unique combo) in memory and a polling timer just does a select where rowid > what we have in memory (to get the latest rows added). Timer runs every second or so and the fast sql reader does it's job well. So far so good. However I feel this is not optimal because sometimes there are pauses in the data writes due to the process by design. (user clicking the pause button on the system that writes data). Meanwhile our timer keeps hitting the db and does not get any new rows. No errors or anything. How is this situation normally handled. The app that writes the data is separate from the reporting app. The 2 apps run on different machines. Bottomline : How to get data into a c# app as and when it is written into a sql server table without polling unnecessarily.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved