|
Well does it need to be a console application or a Windows Forms application? Or even an ASP.NET application? The basic principle remains the same...it's just a matter of gathering that input from the user.
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
|
|
|
|
|
How about voice recognition? That'd be cool
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Even better, thought recognition. The ultimate lazy mans computer.
|
|
|
|
|
It looks like you want to add two numbers
Would you like help?
- Get help thinking of a number
- Just carry on adding without help
Oh god...
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
And since it's a thought computer, the thing is going to project an image of Clippy directly into my optical nerves. Great.
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
|
|
|
|
|
Hi,
I have to write an application which extensively uses an SQL Database. For a simple example say I have the following tables with the appropriate fields.
1. Company (ID, Name, AddresseInfoID)
2. AddresseInfo (ID, Street, City, Zip)
(Those two obviously have a relationship)
Now I'd go and create an object called Company and one for the AddresseInfo. AddresseInfo would be a public member of Company.
Usually you'll have more than one company to manage so I create a strongly typed collection called CompanyCollection.
Now on to the questions:
1. Should each individual object be responsible of loading and saving it's data from and to the database or should the CompanyCollection take care of it (which IMHO seems a lot less coding to me on first sight)?
2. Assumed the Collection takes care of the data-fetching, how should then the data changes whithin the individual objects be handled? What comes in mind is either a IsDirty property of each of the BusinessObjects (Company and AddresseInfo) (which can be checked by the collection) or an event (say DataChanged) to which the collection would hook up.
The problem I see with this approach is the following. Say my MDI GUI displays a list of all Companies in a TreeView on the lefthandside. On DoubleClick the selected BusinessObject gets displayed in a new "Document Window" which hosts a PropertyGrid control. Now my user opens 3 Companies and changes the data of all of them. How would I then handle the situation when he only wants to save to of those documents?
Here is some additional information which I feel might be usefull:
a. The amount of BusinessObject loaded from the Database is never really huge. Say a maximum of 2000 objects.
b. BusinessObjects might contain collections of other BusinessObjects, e.g. the Company object will contain a EmployeeCollection.
c. The amount of different BusinessObjects will probably not exceed 20.
d. Performance issues are not a knock out criteria.
e. The solution that I'm after is simple to code and maintain. I don't actually want to create a huge Framework with hundrets of classes which provide for unlimited scalability and the forth. We are talking about an application which is used by 10 people and new versions can be installed at any time if required.
I hope someone can give me some advice on how to design this properly.
Thanks in advance,
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
|
|
|
|
|
hi,
Good question. See i can help some part of your problem. Say
Mathias Wrote:
The problem I see with this approach is the following. Say my MDI GUI displays a list of all Companies in a TreeView on the lefthandside. On DoubleClick the selected BusinessObject gets displayed in a new "Document Window" which hosts a PropertyGrid control. Now my user opens 3 Companies and changes the data of all of them. How would I then handle the situation when he only wants to save to of those documents?
So some cases user may changes few document against a list. Here you can use indexcer to get proper instance of object from your collection which hold real updation. I think this is the better way to know and choose a perticular record which have updation. I already faced the same situation that you mentioned in your queary. Here i applied indexcer to tackle my issue. And it is pretty fast than checking all objects in collection.
Sreejith Nair
|
|
|
|
|
You Wrote:
The problem I see with this approach is the following. Say my MDI GUI displays a list of all Companies in a TreeView on the lefthandside. On DoubleClick the selected BusinessObject gets displayed in a new "Document Window" which hosts a PropertyGrid control. Now my user opens 3 Companies and changes the data of all of them. How would I then handle the situation when he only wants to save to of those documents?
In My Opinion:
Save one on one basis that is "Save" can be done on open screens only. When your application user double clicks the company tree view a "document window" with company details with a save button will be presented to user. If the user want to persist the chages, he'll hit save and your code will invoke save inteface on the business object. This will save you scanning all objects in collection and will also save you from maintining that which objects have been changed.
Some other suggestions:
Creating objects for all companies may not be an optimal idea. Only fetch company names and Identification info (IDs) from database and render it to tree view. Obviously these objects will be lightweight as no company info is fetched. Now, if your app user selects a company, create a Object of Class Company with all the company details and render it to user.
hope it helps,
Hatim Ali.
|
|
|
|
|
|
Hello, I´sorry, my english not´s very good.
Send my one example:
1- Read one word document in C#
2- add one value in n positions.
Please, your e-mail write in spanish
|
|
|
|
|
|
My problems are:
1- Insert an read one value in one positiion, in the document, in the specific paragraph, for example, insert my name in te line 1 of paragraph 2, in the position 13
This is example number 3 for book C# Proffesionals Projects
Please, my english not is very good. Sorry.
|
|
|
|
|
Hi,
I've searched hi and low to find out how you can draw outside of the Form, but haven't found anything! I posted the same question on the VB.NET forum, but didn't get a single response.
Please can anyone help?
I'm trying to draw rectangles outside of my Form, of course it gets Clipped by the Form itself. I've tried to modify the Clip for the Form, but I can't seem to change it whatsoever. Is it possible to create a Graphics object for Windows itself? So that you can draw anywhere on the screen??
Any help or advice would be much appreciated!!
Many thanks!
Richard
|
|
|
|
|
The way forms (which are just windows) are handled in Windows means that each application can only really draw on its own windows (I say only really, because I'm sure there are ways you could hack into the windows API and draw over some other app's windows)
The problem is that the other app will refresh, and re-draw whatever it wants in its own window (as you'd expect)
How about opening a frontmost form of your own, and setting the whole thing to be transparent (you can set a transparency colour, iirc, which will make any part of your form painted in that colour become transparent, and show the window behind)
You can then draw all over that form to your hearts desire, which should have the effect you're after
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
hi,
I want to pass the database name to a crystal report
i don't want the database to be static
of course the report opened in crystalReoprtViewer from the C#
thanks
|
|
|
|
|
You might consider a better approach that is more robust: use an ADO.NET DataSet . If you build a typed DataSet using xsd.exe or Visual Studio .NET (add a new DataSet item to your project; or drag a table, view, or stored procedure that returns a result set from the Server Explorer). When designing your report, bind to that typed DataSet and you can design your report just as if you built it against a connected database.
Before displaying your report, you get the DataSet however you see fit - from one SQL database or another, or from an Oracle database or even read from an XML file representation of a DataSet - then pass the instance to the SetDataSource method of the ReportDocument .
This way you can use any data source you want, so long as the data ends up in a DataSet that uses the same schema as the typed DataSet you've designed.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Server Error in '/MSPOS' Application.
--------------------------------------------------------------------------------
DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name REPORTTO.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name REPORTTO.
Source Error:
Can someone help me with this one they say that databind.eval is sometimes to fast.
private DataSet BindUserNames()
{
// Populate the ddlDataSet
OdbcConnection myConnection = new OdbcConnection("DSN=POS;UID=system;PWD=system");
myConnection.Open();
const string strSQLDDL = @"SELECT USERID,REPORTTOID,USERNAME,GetUserName(REPORTTOID) AS REPORTTO FROM TBUSERS";
OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
ddlDataSet3.Clear();
myDataAdapter.Fill(ddlDataSet3, "ddlReportTos");
myDataAdapter.Dispose();
myDataAdapter = null;
// In next 2 lines, Dispose removes connection string info, Close is better.
// Use one or the other, but not both...
// myConnection.Dispose();
myConnection.Close();
return ddlDataSet3;
}
//************************************************************
<asp:templatecolumn headertext="Reports To">
<itemtemplate>
<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "REPORTTO")) %>
<footertemplate>
<asp:dropdownlist id="insertReportTos" datasource="<%# BindUserNames() %>" datatextfield="REPORTTO" datavaluefield="REPORTTOID" runat="server">
<edititemtemplate>
<asp:dropdownlist runat="server" id="ddlReportTos" datasource="<%# BindUserNames() %>" datatextfield="REPORTTO" datavaluefield="REPORTTOID" selectedindex="<%# GetSelectedIndexReportsTo(DataBinder.Eval(Container.DataItem, "REPORTTO").ToString())%>">
|
|
|
|
|
This question should be posted in the ASP.NET forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
While learining .NET, I've come across some concepts that I'm not sure if I should avoid them. What I mean is that I've been told that I should avoid using Win32 API calls and stuff like that in a dotNet application (just write pure .NET and not involve Win32 directly in my application). But I'm not sure about if it's possible and even wise. Is it ?
Any good article somewhere how to avoid Win32 dependancy (to ensure Mono/Linux compatibility) ?
There are some objects that I'm not familiar wether they're .NET or Win32:
1. System.Windows.Forms.Message - as I've understood so far, Win32 uses messages and dotnet not. So it's a wrapper to Win32 message ? Should I use messages when developing user interface in C# ?
2. Hooks - if I'm already dealing with messages there's no need to avoid them, right ?
3. Handles - System.IntPtr - I have a feeling they're also more Win32 than dotNet ... are they ???
I hope the questions make sense at all ...
Regards, Desmond5
|
|
|
|
|
The best place to get answers for these are on the forums for Mono, .Gnu, and Portable.NET.
Most of the base class library encapsulates native Win32 functionality, BTW, not just Windows Messages. Most of the Windows Forms controls encapsulates the Windows Common Controls while much of the System.Drawing classes encapsulate GDI+. The list goes on.
The fact of the matter is that what's on the surface is what counts. So long as the base class library in the non-.NET implementation of the Common Language Infrastructure (CLI) implements the same Types and Type members, you'll be fine (and also that the assemblies have the same strong name).
While System.Windows.Forms.Message may not be good to use, you don't have to so long as you don't try to implement Common Control custom functionality (like custom drawing).
An IntPtr , BTW, is just a native handle, which is a 32-bit integer on 32-bit platforms and 64 bits on 64-bit platforms.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
hey to all,
i am trying to parse a source file to determine the class name from its signature using regex
i can get it as long as the file doesnt include anything after the '{' in the signature,
can anyone offer help pls?
[code]
Regex regex = new Regex(@"(?<=\bclass\s+\b)\w+(?=\s*\{)");
this works fine for examples like:
// this is class file
public class Tester
{
}
internal class InternalTester{
}
// output misses commented 'class' keyword, this is good
[/code]
but if i have say a java example or if i extend a class it fails
like:
[code]
public class Form1 : System.Windows.Forms.Form
{
}
// or java
public class Listener extends Thread
{
[/code]
also i would like to be able to change the keyword it is trying to find with something this (which is wrong)
[code]
static string KEYWORD = "class";
Regex regex = new Regex(@"(?<=\b" + KEYWORD + "\s+\b)\w+(?=\s*\{)");
[/code]
any suggestions pls ?
kind regards
maurice
|
|
|
|
|
Doesn't answer your question but it may help
Regulator[^]
|
|
|
|
|
I am trying to escape quotations in the following scenario:
I have a string variable, and text that I need to pass to a system command. But I need to include quotes IN one of the elements of the system command.
string gar = "Variable";
string subject = gar + "Here is some more text";
System.Diagnostics.Process.Start("command.bat" + gar);
The kicker for me is that the subject MUST include quotes (") around the entire variable to the command line like this:
c:\command.bat "Variable Here is some more text"
Any ideas ?
--
sween
|
|
|
|
|
How about this:
string subject = "\"" + gar + "Here is some more text\"";
www.troschuetz.de
|
|
|
|
|