|
thanks for the reply.
where do i add that code? do i put it in my TabPage constructor?
Im a beginner,sorry.
|
|
|
|
|
Are you going to have more than one Employee Tab Page open at any time or likewise more than one Customer tab open. If you're not then it's an overkill to create an inherited tab control.
If you are using more than one instance of each type of tab control then basically you need to do this:
- Inherit from a TabPage (easiest way to do this would be to add a UserControl to the current project from VS and then view the source code and change it to inherit from a TabPage).
- Add all the code required for these tab pages.
- In your event handler / what ever you are using to add tab pages replace:
this.tabs.Pages.Add(new TabPage()) with this.tabs.Pages.Add(new CustomerTabPage())
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hello:
I'm trying to generate code using the CodeDom, and I need to know how to get an expression from an assign statement.
I'm using CodeBinaryOperatorExpression but I get the generated code within parenthesis, for example:
( a = 0 );
I'd like to know if I can get the code without parenthesis using the previous class or someone else.
Thanks
Pablo Hernandez Valdes
|
|
|
|
|
CodeBinaryOperatorExpression is always going to use the parentheses. This way it can always be safe with order of operations. You can't really remove the parentheses using CodeBinaryOperatorExpression . What you may want to try, if you can, is to use a CodeSnippetExpression . If the expression will work in all the languages you're generating, then you're fine. Otherwise, you have to live with the parentheses.
|
|
|
|
|
I know how to connect to a database on a networked machine using C# code directly, thats pretty simple. But I'm trying to use things like data grid forms that have to just select the data source. Using the Data Source Wizard I can't figure out how to tell it to connect to machine X, database X, pass X, username X just like I would using code. It keeps insisting I connect it directly to a database file, which isn't shared. Am I missing some REALLY obvious answer?
-- modified at 17:15 Thursday 1st June, 2006
C# Express 2005 Doesn't have this feature?
|
|
|
|
|
What type of database are you connecting to? I'd assume based on your comments so far that it's an access database in which case you must specify the a valid network path to the database, e.g. \\machineX\c\database.mdb in the connection string, the username and password can also be specified in the string if requried.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
"data source wizard for SQL" is the topic, so I'm not connecting to access =P
I just got a full copy of 2005 from work and solved my problem. I dont think the data objects are predefined and all that in Express for a server connection.
|
|
|
|
|
guys i created a program in c# that works with the phoneline but i am stuck my programmes works per4fect at times but then in some instances i get this error
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MySerialPortReader.CallAccountingService.doInsert( IEnumerable arr)
at MySerialPortReader.MainFrame.RecvTimer_Tick(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
MySerialPortReader
Assembly Version: 1.0.2319.21736
Win32 Version: 1.0.2319.21736
CodeBase: file:///C:/cpp/MySerialPortReader/Release/MySerialPortReader.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
SerialPorts
Assembly Version: 1.0.1649.29449
Win32 Version: 1.0.1649.29449
CodeBase: file:///C:/cpp/MySerialPortReader/Release/SerialPorts.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::
but i dont know whats is causing this error to be occuring or how i can handle it properly so it will affect my program
kenny
|
|
|
|
|
keroed_edmond wrote: System.NullReferenceException: Object reference not set to an instance of an object.
at MySerialPortReader.CallAccountingService.doInsert( IEnumerable arr)
at MySerialPortReader.MainFrame.RecvTimer_Tick(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dw
That's the important bit, ignore the rest it's mostly waffle. You're trying to access a null object in CallAccountingService.doInsert . You'll have to step through the code if you don't know off-hand what's causing this. If it seems completely random could it be something to do with the serial port not receiving some data or something like that where it only happens once in a while.
Start with objects that are only dealt with inside the CallAccountingService.doInsert function first since variables dealt with in more than one of the listed functions are less likely to be the cause. Although it all depends on how you've written and structured the code.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Ed.Poore wrote: Start with objects that are only dealt with inside the CallAccountingService.doInsert function first since variables dealt with in more than one of the listed functions are less likely to be the cause. Although it all depends on how you've written and structured the code.
it works some time and others it does'nt the thing is while i am getting the information from the port reader i am simultaneously retrivin information from the database to do soem calcualtaion and then right the data from the port reader along with the calaculated value to the database so i dont know if is a case where when too much information is coming it doe'nt get a chance to handle the calculation and insert the data before more information comes into the system
kenny
|
|
|
|
|
I wouldn't have throught so since RS232 ports may be old and slow but they are incredibly reliable, if there's a loss of data it's your (or whoever wrote the drivers etc) fault as I've found out on numerous occassions. My father has run tests on all the Serial Port components for VB6 and found that the Microsoft one was by far the most reliable, stuff like Sax didn't do as well.
You're getting the error message because you havn't run it inside the debugger. If you can run it inside VS and it should break on the line which has the null reference, thereby pinpointing your cause immediately.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
i think i solved the problem because data was been retrive from a database when someone dialed an incorrect number anull value was been returned which inturn lead to a ecption because my port reader is expectiing a valid return vlue to use in a calculation, but the thig is at the momment i am one of two application developers i did c, but not c# but the port reader is in c# and i am learning c# but i am not that knowledgeable in the rs232 and little one two tricks f the trades to do eerthing presentl i was jus the webapplication developer using my asp.net, asp and flash and so on but the other guy leavign so i know that his work load is going to eb mine pretty soon, is there anyway u could point me to some good lcations that i can read up on rs232 and how to create supporting solutions to work with them possible even a forum i am suppose to be looking into these two ne ones a mitel smdr and AVYA I think the other one was
kenny
-- modified at 18:13 Saturday 3rd June, 2006
|
|
|
|
|
I don't know of any sites that deal with RS232 specifically, what I know has been achieved through experience. If the reader is in C# then it's just a case of reading and writing bytes to a stream. If you know for definite that you're going to inherit the code then get the other developer to explain the general gist of things to you so that at least you don't have to start from scratch.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
yea fi real i was thinking that would be best, so i think i going to ask him to explain it to me this the problem is that he is not there often, can u send me to a link that shows me how to read and write to byte streams
kenny
|
|
|
|
|
From your JIT error you're using .NET 1.1 which doesn't have a built-in class for dealing with RS232 stuff, .NET 2 does however in the System.IO.Ports namespace. To use this is exactly the same as using a filestream just use the many overloaded Write, WriteLine, Read and ReadLine functions.
You're library (at a guess) MySerialPortReader as this, it may be a wrapper around an existing control or it may be one written from scratch. I cannot tell so I cannot provide any more help.
If you just want to learn how to use the RS232 port the best thing that I can suggest is (if you have two PCs or two serial ports) link them together. Get hold of v2 of the framework so you have a standard component for accessing the serial port. If you're happy programming with Notepad / SciTE / whatever then use that, if not either get hold of the free C# express edition from MS and just create a simple application such as a terminal which anything you write into a textbox gets sent to the serial port, anything received is written into another textbox, you can then add more code to experiment quite easily.
If you only have one PC and one serial port then I strongly suggest making a loopback connector, this acts like 127.0.0.1 but for the serial ports. Essentially what you do is get hold of a female plug for connecting into the back of the PC (you can either buy one, nab one or cannabalise one from an old mouse or someother peripheral), then all you have to do is connect pins 2 and 3 together. If you plug this into the back of your computer, any data sent from that port will be looped back and sent into the same port.
Since I don't know what MySerialPortReader is I'd highly recommend getting .NET 2 for experimentation at least since then everyone including myself has access to the documentation and a similar system.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
|
i am work on creating a reader for a mitel smdr but i dont have any at the moment so currently i am jus reading from a text filed nd doing my adjustments to what i would want the dtaa for.....but i was wonering is there any way i could tste sending the data to the portreader and retriving it??? i found some programms on the internet but they dont seem to be wrking because when i attach my pc to another pc via the serial port and click send for the other pc to send me data i dont recieve it.....is there any program u know that jus accepts a string and sends the data to my pc from their serial port reader..................i was looking at code sample ugave me but i not sure where would iput it would i simply double click on the form i created and go to that code behing that form????
kenny
|
|
|
|
|
keroed_edmond wrote: send for the other pc to send me data i dont recieve it
Unless there's a program sitting on the other end it won't send back any data at all. The best bet would be to create a simple program in .NET 2 that will allow you to send data across the port from the other computer to the one which you are writing the PortReader on.
Just open up VS2005 or the Express editions, drop a SerialPort from the Toolbox onto the form, three buttons and a textbox.
One button will serve as the "Open Port" button, in the event handler put this.serialPort1.Open(); in it.
Another button will serve as the "Close Port" button put this.serialPort1.Close(); in it.
The third button will send the contents of the textbox to the serial port, just put this.serialPort1.Write(this.textBox1.Text); in the event handler.
And there you have a rudimentary write-only terminal.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
question if i create a simple read porter reader program right and i goign to wirite the data to a database will there be any time delay issues if it is implemented on a pbx system that has a high volum of calls????
is there anything i can do to prevent a errorr if a error is possible because of this situation
kenny
|
|
|
|
|
keroed_edmond wrote: implemented on a pbx system that has a high volum of calls
Since I don't know what a pbx system is I wouldn't know. If written correctly I wouldn't have thought so, always keep in mind that RS232 ports have a very high interrupt priority since they don't care if data is received correctly, if you're too slow to do anything about it then that's your problem.
You'd just have to experiment and optimise things appropriately, I don't have an overview or any information on your system so can't help you I'm afraid.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
yow question right the program i wrote to read from the com port works when i try to use itto read from norton smdr right, the data format is wrong because i bulding it for a mitel smdr but thats cool ijus wanted to make sure thatit was readig from the port but when i try running it on a mitel smdr i dont get anything its like it is not even reading from the port i am sure t opens the port becase if i try to run hyper terminal i get an error saying the port is already been opened so iknow my programm has opened the port, but its the reading that giving the problem have u ever encountered thi problem before? or heard fo this problem
u know any possible hints to what may be wrong
kenny
|
|
|
|
|
You're probably not talking to the Mitel SMDR properly, since I've never heard of one of these, much less know what protocol they use I don't know.
There should be some diagnostic command that you can send to the Mitel to get it to respond, e.g. modems have some sort of "OK?" command which they respond to with OK to show that it is up and running, have a dig through the documentation for something like that.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
oh cool u have any ideas what i should check out to see if i am communicating properll with the smdr?? are the other things other than the baud rate,port name,parity, and stop bits????
kenny
|
|
|
|
|
All those should be defined in your documentation for the smdr. There should be a simple "OK?" -> "OK" test message or something similar as one of the command, just to ensure comms are working correctly, see if you can get this working first (I mean even the Lego Mindstorms has this!).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
Hi, i was wondering if it was possible to rightclick an item in a listview and display a menu.
for instance rightclicking an item in a listview and then be able to click "delete" to clear the specific item
Don't be overcome by evil, but overcome evil with good
|
|
|
|