473,785 Members | 2,879 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Documents on MDI forms with Dataset?

al
Greetings,

Thanks in advance for your kind attension.

I have been searching for documents about dynamically coding MDI forms
when working with datasets. Does anyone know of any???

MTIA,
Grawsha
Nov 20 '05 #1
6 1321
"al" <gr*********@ya hoo.com> schrieb

I have been searching for documents about dynamically coding MDI
forms when working with datasets. Does anyone know of any???


Apart from <F1> I don't know any documents. ;-)

Do you have a specific question? Maybe I can help.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
al
"Armin Zingler" <az*******@free net.de> wrote in message news:<uv******* *******@TK2MSFT NGP11.phx.gbl>. ..
"al" <gr*********@ya hoo.com> schrieb

I have been searching for documents about dynamically coding MDI
forms when working with datasets. Does anyone know of any???


Apart from <F1> I don't know any documents. ;-)

Do you have a specific question? Maybe I can help.


I basically look for a way to avoid hard coding column names in the
SQL statement when I send changes (delete,udate and insert) back to
the database(i'm still working on the logical development. of the
app). The case is like thsi: I have a MDI form with a couple of
children forms(employees and customers). The related datatables(dt) in
the dataset(ds) is filled from database when its related form is
first loaded(table customer is filled when form customer is first
loaded). I refer to AciveMdiChild.T ext in the MDI parent to load that
child form.

User, say, deletes a record by clicking a button to send the changes
to the database. There will be one button (on the toolbar of MDI
parent)for each operation (delet, update and insert). Now, my
problem comes when I try to write the SQL statement to send changes
back to database. That is, I don't want to hard code the column name
like this:

Dim str as String="Delete from employees where employeeID=@emp loyeeid"

This will force me to write another SQL stat. for the the customers
form, which I do not want to do.

In this string, I was able to substitute the table name with the
ActiveMdiChilde .Text property. Now, to substitue the column name, I
look at the location of the related column name in the underlyning
datatable in the dataset, but the problem this column(usually Primary
Key,PK) does not have fixed location(it might be col 0 in one
employees table but col 1 in customers table ) or it might be 2
columns in some cases.

This is still hard coding the location of the column name:

Dim str as String="Delete from" & ActiveMdiChild. Text & " where " &
ds.tables _(ActiveMdiChil d.Text).Columns (0).ColumnName & "=@" &
ds.tables _(ActiveMdiChil d.Text).Columns (0).ColumnName

How should I DYNAMICALL refer to the location of the column name in
the underlyning datatable??
Should I use class or interface or what??? Remember, the
ActiveMdiChild is a basic form with basic properties,i.e. , I can't
refer to labels or textboxes of the child form. ONLY names,text,etc. .

MTIA,
Grawsha
Nov 20 '05 #3
Cor
Hi Al,

A dataset is never doing things with the MDI form direct but always with
controls placed on it, which can interact with dataset.

Therefore I do not see why there should be an answer for your question, can
you explain it something more?

Cor
I have been searching for documents about dynamically coding MDI forms
when working with datasets. Does anyone know of any???

Nov 20 '05 #4
"al" <gr*********@ya hoo.com> schrieb

I have been searching for documents about dynamically coding
MDI forms when working with datasets. Does anyone know of
any???


Apart from <F1> I don't know any documents. ;-)

Do you have a specific question? Maybe I can help.


[...]
How should I DYNAMICALL refer to the location of the column name
in the underlyning datatable??
Should I use class or interface or what??? Remember, the
ActiveMdiChild is a basic form with basic properties,i.e. , I can't
refer to labels or textboxes of the child form. ONLY
names,text,etc. .


I don't think there is a short answer that explains the details. I can only
give a general answer: I'd store the information on a table somewhere and
pass it to each child. How this can be done is an individual design
question - and I'm usually getting paid for more details. ;-) If you've got
all information about the structure of the table in a DataTable, you can
dynamically built the Form, the SQL and whatever, based on this information.
For example, you can use a loop to process all columns, to build the SQL
string and to fill the Parameters. If you use a Commandbuilder, it's
(usually) sufficient to build the select string and the other SQL strings
(update/delete) are built for you.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
al
"Cor" <no*@non.com> wrote in message news:<#S******* *******@TK2MSFT NGP12.phx.gbl>. ..
Hi Al,

A dataset is never doing things with the MDI form direct but always with
controls placed on it, which can interact with dataset.

Therefore I do not see why there should be an answer for your question, can
you explain it something more?

Cor
I have been searching for documents about dynamically coding MDI forms
when working with datasets. Does anyone know of any???

Hello Cor,

The basic delma i'm facing comes from two sides. One is User
Interface (UI) requirments and second to be effeciant with coding.
For the first part, there is supposed to be only one button(on toolbar
of the MDI parent) for each database operation. One button to do only
one job(button for update, another for insert and third for delete),
so that both forms use it, or for as many forms as needed, for this
matter. This leads to the second part of the problem. That is, say a
user clicks the delete button, this forces me to have IF condition to
test for the ActiveMdiChild and see which of the children forms is
active. This way I will have to hard code for all of the children
forms. I don't want to that!
Now, having said that, I want to be more specific to get the "big
picture".
With the delete operation , for example,I use SQL statement to send
chagnes to DB.

"Delete from employees where employeeid=@emp loyeeid"

If I do something like this, then i have to do it for all child forms.
What I want is to write ONE delete statement for all forms, i.e.,
DYANMIC one.
I was able to produce the following to get ONE dynamic SQL statement
for All child forms:

NOTE:
*************** *************** *************** *************** *************** ***
ActiveMdiChild. Text reads the child form's TEXT property, which is the
same as the table name in the dataset,i.e., customers form has
CUSTOMERS name as its text
*************** *************** *************** *************** *************** ****

IF Me.Toolbar.butt on.text = "Delete" Then

"Delete from" & ActiveMdiChild. Text & " where" & ds.tables
(ActiveMdiChild .Text).Columns( 0).ColumnName & "=@" &
ActiMdiChi.Text .Column (0).ColumnName

End If

Here, I don' know how to create the dyanmic column location, instead
of hardcoding the location to 0.
Grawsha
Nov 20 '05 #6
Cor
Hi Al,

I type it in here not in the designer so check it good

I have still to asume a lot but I see you use a dataset, I start asuming
that you use datagrids or something and that you want to delete a row from a
dataset from which you know the dataset row.

I think you can than use a shared class for this
\\\
public class Al
public shared sub AlsDelete(byval ds as dataset, byval tabl as string,
byval row as integer)
ds.tables(tabl) .rows(row).dele te
end sub
end class
///
And then when you want to delete a row
\\\
IF Me.Toolbar.butt on.text = "Delete" Then
Al.alsdelete(ds ,"ActiveMdiChil d",rowpositi on)
End If
///
You can give it a try.

Cor
Nov 20 '05 #7

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

Similar topics

3
1888
by: Patrick | last post by:
I have got 2 XML documents, both of which conform to the same XSD Schema, which define possible optional elements. The 2 XML documents contain 2 disjoint set of XML elements. What is the best, easiest, most efficient way of merging the 2 XML Documents? Can I use DataSet.Merge() facility in ADO.NET?? Any pre-requisites? Any other suggestions?
4
1269
by: 2003et | last post by:
Couldn't I create DataSet in child forms???? Is there any solution for this??? Thanks in advance! E.T.
8
1893
by: Grant | last post by:
Sorry for all the posts - Im new to c# and oop and and having a tough time geting my head around some of this stuff. (I tell you Im surprised my monitor has lasted this long, Ive been tempted many times to put the keyboard through it) I have this dataset on my main form which i need exposed to another form. I have comboboxes that need to be bound to this dataset. I have tried creating a new dataset on the new form and what happens is the...
0
4248
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET Applications and owner of Access Microsystems. Doug can be reached at doug@accessmicrosystems.com. --------------------------------------------------------------------------------
4
2501
by: Lewis Edward Moten III | last post by:
I have a file that users can download through a web page protected by forms authentication: Download.aspx?ID=45 and within that file ... FileInfo fileToDownload = new FileInfo(fileName);
2
6903
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form (frmMain) that loads the dataset and reads the data but then I have other forms that give the ability to add, modify, and delete rows. This of course changes the dataset and I need that reflected in the main form. At first I was actually passing a reference of the dataset to the "modify" form...
3
2375
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes get MyVarialble is not declared errors when the variable is quite clearly declared, when I change it to public and then back again to private the error goes away!!! Also I get lots of member not found errors, these however don't stop me from...
4
12442
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
0
1576
by: grmiked | last post by:
Hallo everybody, I am working with VS2005 and have a major problem with VC++ and Crystal Reports that has been driving me crazy for the last 1 week! More specifically, my problem situation can be perfectly described with the following simplified scenario: I create a new VC++ project of type "Windows Forms Application" and add a new DataSet that I connect to a dummy Access database that just contains one table. Then, I add a new...
0
9480
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,...
0
10152
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
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
9950
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
8974
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
7500
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.