Structure Of .net GUI App - Interface To A Database ?

Jan 9, 2010

Strategy on how to structure a VB.net GUI app. I have a application that is basically an interface to a database. It is comprised of a TabControl with 6 tabs, each tab has a few custom controls and performs a business operation on the database.

Tab Functions:

CODE:

Common Code Functions:

CODE:

Currently I've got most all of the operations built into event handler functions on the GUI thread. I'd like to move to a more object-oriented structure for code reusability and easier multi-threading.

I'm struggling with a few design things:

What objects / classes makes sense? Are there industry-standard best practices or design patterns around separating GUI and backend functionality? Any particularly good articles I should read? Is BackgroundWorker the best way to execute the backend functions?

View 1 Replies


ADVERTISEMENT

C# - Structure Map - Registering Wrapper Of An Old Interface For A New Interface?

Nov 18, 2011

in the codebase i'm maintaining there is an old interface. Let's call it IFoo. It pretty much became obsolete and replaced with the Interface INewFoo with a change a few weeks ago, but for backwards-compatibility purposes, i wrote a wrapper class which implements INewFoo and takes an IFoo in the constructor.To clarify, consider the following code.

Public Interface IFoo
Sub DoStuff()
End Interface[code].....

For both interfaces, the implementations are loaded by scanning a few assemblies with StructureMap. Now, let's get to the bad things. Most implementations for the old interface were put into forms for reason i can neither understand nor change. Because those tend to be displayed and disposed, i have to create a new instance every time i use ObjectFactory.GetAllInstances(Of IFoo). Thats still no problem, but i'd like to register a INewFoo-Wrapper for each registered implementation of IFoo, so that i can just use ObjectFactory.GetAllInstances(of INewFoo) and get all implementations of IFoo AND INewFoo.I can't iterate through the implementations of IFoo and register a wrapper for each one because as far as i can see, you can just register those with instances.Wrong code below:

ObjectFactory.Configure(Sub(config)
config.Scan(Sub(scan)
For Each ass In assemblies[code].....

My question is: Is it possible to register a wrapper for each implementation of IFoo which always creates a new instance of the implementation before creating a new instance of the wrapper?

View 1 Replies

Pass A Structure Through An Interface To A Plugin?

May 26, 2010

I'm working on a project where I'm experimenting with building and implementing plugins. I have a structure called "sensor" in the plugin that contains several elements. I would like to be able to return that structure to my main program through the interface, but it doesn't work. The plugin works fine if I'm passing strings or other variable types, but when I switch from strings to my structure, I get a couple of errors. On my main form where I try to call the function, I get the error 'value of type iMyPlugin.sensor cannot be converted to frmMain.sensor'. In the plugin code, I get the error 'GetSensorReading cannot implement GetSensorReading because there is no matching function on the interface'. Is what I want to do possible, or is there a better way to do what I want?

[Code]....

View 2 Replies

Retrieve Database Structure In Dataset?

Apr 23, 2011

Can some one tell me how retrieve database structure in dataset with primary key columns or get the columns that not allow nulls

View 2 Replies

Secure The Database Structure After Deployment In Sqlserver2008?

Apr 28, 2009

I m working on a project using vs2008+vb+sqlserver 2008. How can i secure my database, so that user can't see the structure of my database. I mean she shld not able to see tables and fields of my database. Is it possible in sqlserver2008?

View 9 Replies

Speeding Up Code That Copies Database Structure To XML

Aug 23, 2010

I have a database structure filled with data that I'm trying to write out to an XML file. Here's a taste of the way the VB code is structured:[code]I can't see or report any progress, because the processing is all tied to one giant LINQ query. Even if I can't make it any faster, I'd like to know how much longer I have to wait. My first version of this code had For loops instead of queries, so I could display progress, but it took a loot longer.Obviously I'd like to speed this up considerably. It seems like there should be a simpler way to convert the data to an XML file, especially since the database structure was created from the XSD in the first place.

View 1 Replies

Database - Import CSV To Class Structure As The User Defines?

May 28, 2010

I have a contact manager program and I would like to offer the feature to import csv files. The problem is that different data sources order the fields in different ways.I thought of programming an interface for the user to tell it the field order and how to handle exceptions.Here is an example line in one of many possible field orders:

"ID#","Name","Rank","Address1","Address2","City","State","Country","Zip","Phone#","Email","Join Date","Sponsor ID","Sponsor Name"[code]....

Notice that in one data field "Name" there is a comma to separate last name and first name and in another there is not.My plan is to have a line for each field (ie ID, Name, City etc.) and a statement "import to" and list box with options like: Don't Import, Business>Join Date, First Name, Zip

and the program recognizes those as properties of an object...I'd also like the user to be able to record preset field orders so they can re-use them for csv files from the same download source.Then I also need it to check if a record all ready exists(is there a record for Anson Call all ready?) and allow the user to tell it what to do if there is a record(ie mailing address may have changes, so if that field is filled overwrite it, or this mailing address is invalid,leave the current data untouched for this person, overwrite the rest).

While I'm capable of coding this...i'm not very excited about it and I'm wondering if there's a tool or set of tools out there to all ready perform most of this functionality...

View 2 Replies

IDE :: Create Classes And Forms Based On A Database Structure?

May 10, 2010

I am creating an Add-In that I want to create classes and forms based on a database structure. I can't find any information anywhere on how to programatically add code to classes. I know I can write out the files and add them to a project, but that would limit what I can do in the future. I would like the possibility to update a function in the future which would be impossible writing out a file and loading the whole thing back in. It would destroy any modifications made to the class, and since this Add-In will only be creating a framework, there will usually be modifications.

I got this line from the macro recorder:DTE.ActiveDocument.Selection.text = strDACode

But I like to keep Option Strict on, and this is late bound according to the IDE. There seems to be very little help on the IDE and how to use it creating Add-Ins. If I overlooked something please point me there, but I can find nothing. I don't know if it can be done, but I was able to do it in an Add-In for VB6.I would also like to add controls to a form, so if anyone can point me somewhere where it explains

View 3 Replies

Save DataTable Structure And Data Into A Database Table?

Mar 10, 2010

How to Save DataTable Structure And Data Into A Datatbase Table..

View 7 Replies

Structure Inside Another Structure Receives Null Reference Error?

Jan 5, 2012

Module Module1
Public Structure structure1
Public TRANS() As structure2
End Structure
Public Structure structure2
Public X() As Integer
End Structure
End Module

View 17 Replies

Class Structure - Large Structure That Has Lots Of Properties ?

Jan 5, 2010

I'm new to VB 2008 after having spent a long time with VB6, so I apologize if this is a stupid question. But I'd really like to have this straightened out.

Let's say I have a pretty large structure that has lots of properties.

Code:

Now say that I want an internal database with about 10 instances of this structure total, describing, say, 10 different products that a store sells. When these values are loaded from a database, they remain totally static. (However, they can be different each time a program loads)

Now say that I have a class. Each instance of this class is a type of that BaseProduct structure. Meaning, each instance of the class pertains to one of the 10 types of products that the store sells. However, this class has additional properties that pertain specifically to each instance, which are not static.

Code:

Now, the problem here is... If I have 200 different transactions, each one contains an instance of BaseProduct. BaseProduct is HUGE, and is largely redundant (only 10 types possible), so I think it's a little silly to include a whole copy of it with EVERY transaction. However, the Transaction class really needs information regarding the base product it pertains to. Is there a way to, instead of declaring a New BaseProduct in the Transaction class, to simply make one of the properties of the Transaction class a pointer to a BaseProduct variable?

In VB6, I would accomplish this by making a BaseProduct(10) array, and then giving each Transaction an ID number referring to an entry in that array. But in VB 2008, using class structure, this is impossible. I can't define the BaseProduct(10) array outside of a class in a namespace, and if I define it in the actual application's form, then the class loses modularity since it relies on the application that's using it.

View 11 Replies

Converting Structure Within Structure To Byte Array For Socket

Aug 29, 2009

I am trying to communicate with an external device and i am trying to send a byte array to the external device via sockets but i am always getting a response the message size is too small so i am not sure what i have done wrong. Between the data type there should be no alignment present and all numbers are represented in little endian format. The char array is not null terminated as mentioned in the protocol specifications.

I have to send data based on a struct that embeds 2 other struct. So here's my vb.net code for the struct used to convert to byte array and the sending part.

Public Structure MESSAGETYPE_OIP_Login
Dim Header() As COMMANDHEADER
Dim UserName() As PSTRING

[Code]....

View 2 Replies

Get Program To Interface With A Database?

Mar 8, 2011

for my A2 computing project, I need to get my program to interface with a database. Now I'm having a problem in updating records on the database. Here's what I've got so far.

Sub LockProgram()
'this updates the program to be locked, to prevent peoples trying to force their way in.
'it is simply some basic validation and an update statement on the database
If loginAttemptsToday >= 5 Then

[code]....

My program will read from a database perfectly, it will delete and add rows, but it simply will not update?

View 5 Replies

Invalid Structure Size When Marshalling C Structure To .NET

Apr 14, 2012

I'm experiencing a problem with the following c-structure:

typedef struct tagTEXTUREPROP
{
DWORD dwSize;

[Code].....

The Marshal.SizeOf obviously calculates a size of 76 and it works with the DLL function, but it leaves me with some bad feelings.

View 1 Replies

VS 2008 Convert The XML Structure Into A Class Structure?

Apr 25, 2010

I'm having a problem that's driving me crazy; I can't understand how to convert the XML structure into a class structure (that I want to use to hydrate a XML document).

The XML document looks like this:

xml
<?xml version="1.0" encoding="utf-8"?>
<artists xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.spotify.com/ns/music/1">

[code]....

View 2 Replies

Data Only Delete From The Interface But Not From The Database?

Jul 15, 2009

in my form..there's a couple of textboxes..these textboxes display data from the database using databinding method...my problem is when i click on my delete button to delete the data displayed in those textboxes...the data will be gone from the textboxes...but when i check my database..the data is still there.....how do i solve the delete button problme???...i want the data to be delete from the textboxes AS WELL AS from the database.

here's my delete button code

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim intresult As Integer
Try

[code]....

View 1 Replies

Choose An Interface From A Server And Then Displays The Database?

Jun 8, 2012

how to choose an interface from a server and then displays the database and then displays the objects of this comic

View 1 Replies

Create Database User Interface Design?

Mar 31, 2012

I am designing a database using access 2010 and I ve been asked to design the user interface with Visual basic.I actually have designed tables and their relationship and did some queries according to the requirements. how do I create user interface in VB from this point knowing I don't have any form and report designed in access?

View 6 Replies

Interface And Graphics :: Draw Image From Database?

May 13, 2009

I am trying to draw an image from a MS Access database by use of e.Graphics.DrawImage(New Bitmap()). In my database Row 0 Item 1 holds the path to the image I want to draw.

My current code looks like this:

Code:
Private Sub pnlStart2_Paint(ByVal sender As Object, ByVal e As_ System.Windows.Forms.PaintEventArgs) Handles pnlStart2.Paint
e.Graphics.DrawImage(New Bitmap(ds.Tables("Track1").Rows(0).Item(1)), 3, 3)
End Sub

When I run my program I get the following message in my code: Illegal characters in path how I can draw the image from the database?

View 6 Replies

Screen Interface And Database Design View?

Apr 3, 2012

I am using visual studio 2008 professional edition, and i need some help in my assignment project.below are my screen interface and my database design view, relationship view, and coding and this is my coding Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

[Code]...

View 3 Replies

Data In MS Access Database Our Of Order With VB 2010 Interface

Jun 20, 2012

VB 2010 Express + MS Access 2003

today I successfully configured an interface to work with a test database I created in MS Access 2003. The database consists of only 8 records with 10 fields.

I used the basic built-ins with VB 2010 to build the interface in a simple form which shows only 6 of the 10 fields. It all seems to work well, that is the connection string built correctly, and I can run the program and view the individual records. My trouble is that when it goes to the 1st record it's actually the 3rd record in the database. And when I go to the last record it's actually the 2nd record in the database and the next to the last record is actually the first record in the database.

why the program seems to start at the 3 record and shifts the first two records to the end. All the records show up, it's just that they are somewhat out of order.

View 3 Replies

GUI - User Interface For Capturing Data Into A Budget Database

Mar 12, 2010

I want to do a user interface for capturing data into a budget database but ran into a problem. Budget items are captured one line at a time. For example, say a Company wants to prepare budget for 2010, the entry may look like this;

[Code]...

View 5 Replies

Arraylist Of Structure Within Array Of Structure?

May 23, 2010

I want to make a structure within a structure. Basically it will appear like this:

Structure ID
dim CardType as string
im CardCode as string

[code]......

View 13 Replies

Assign Array Of Structure To Another Of Same Structure?

Oct 12, 2010

In Vb.net I am trying to assign an array of structure to another array of same structure[code]...

View 2 Replies

Make User Interface To A Database With Visual Basic (vs2008)?

Feb 4, 2011

Write code or use tableadaptors, bindingsources, dataset, etc.? I have experience with the older ways i.e. connection strings, ado code, sql, etc. but was hoping the newer tools in vs would make the user interface easier and more flexible. So far i have been disappointed. Am I wrong and I am missing something? Am I alone in this opinion or ? What is your past experience in VB and have you found vb.net to be a step forward in db user interface design? if your answer is yes then what is the easiest way to put a table record count into a text box? should i bypass all the new stuff/objects ( adaptors, binding sources, navigators, designers, etc) and just write code or what?

View 3 Replies

IDE :: Modify A Database Class Called TermsDB To Implement The TermsService Interface?

Nov 22, 2010

I created an interface - TermsService.vb and defined the following method : Function GetTermsList() As List (Of Terms)

how do I modify my TermsDB class to implement the TermsService interface I've just created? Here is my code: Have I implemented it correctly?

Imports System.Data.SqlClient
Friend Class TermsDB
Implements TermsService

[Code].....

View 1 Replies

Find Sample System With Complete Flow, Database Structure And Data Flow?

Jul 21, 2009

where to find sample system with complete flow, database structure and data flow.. just for reference purpose.. system like inventory, payroll, accounting, billing and etc..

View 10 Replies

Forms :: Create Database Connection String Builder Like SQL Connect To Server Interface

May 21, 2009

I am trying to build a user control that will do exactly what the SQL 2005 Connect to Server interface do, eventually create a connection string and store in a app.config file. It should allow user to select server type, server name, authentication, user name and password. It should also automatically load available servers and domain login by default.

View 11 Replies

Interface And Graphics :: Adding Multiple Checkboxes On FormLoad Depending On Amount Of Items In Database

Oct 20, 2008

The Title says it all Adding Multiple Checkboxes on FormLoad Depending on Amount of Items In Database. [code]

View 4 Replies

Interface And Graphics :: Create A User Interface In A Game Such As The Application XFire Using VB?

Jan 12, 2010

how to create a user interface in a game such as the application XFire using Visual Basic?

View 3 Replies







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