|
It appears like you are in the very early steps of the battleship program creation process. So, I would suggest that you map out the program with what classes will be needed, what properties/methods need to be exposed in those classes, create a basic layout for the appearance of the form, etc.
Once you have a blueprint of the entire program that I can help you formulate the blueprint into code. I believe I posted my battleship program (not code) on my website awhile ago: http://homepages.umflint.edu/~thstockw/[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I'm importing data from a csv file and I need all the fields to be read in as text fields.
I have a zip code field that when I need to put in ZipCode+4(12345-6789) it throws an err because the field is interpreted as a int32 or some such.
I don't see any options anywhere to force the driver to make all the field text either. I thought this is possible, I'm pretty sure it would work with the Jet drivers if they were installed.
If they are installed, they are not showing up in the ODBC Data Source Administrator.
Connection.ConnectionString =
string.Format(@"Dsn=CSV;dbq={0};defaultdir={0};driverid=27;fil=text;maxbuffersize=2048;pagetimeout=5", new FileInfo(openFileDialogGetCRDCSV.FileName).DirectoryName);
|
|
|
|
|
|
That would almost work except the header names are subject to change. The file also comes in with column names with "." and it converts them to "#". I think I'm going to have to switch to a CSV parser of some kind.
|
|
|
|
|
Sunset Towers wrote: header names are subject to change
That doesn't matter. You don't have to name the columns (set ColNameHeader to true) and if you do, it's the name you decide, not the name in the file.
Sunset Towers wrote: The file also comes in with column names with "." and it converts them to "#".
Din't quite understand this.
|
|
|
|
|
The column names are something like column.name which csv is coverting to column#name. Not a big deal.
I can set the column names as they move around also. It's weird and a pain but I'll have to find a different solution.
|
|
|
|
|
|
You may want to take a look at this CSV parser[^] and then use Bulkcopy to load the data into a table. I always use a staging table and a stored proc to do my ETL.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yeah that is a the route I had to take in the was just to get a csv parser.
|
|
|
|
|
Hi All,
I'm just trying to find some info on how to tell xUnit to output the results from a set of tests I've written for some C# code. Info seems really thin on the ground for this. Can anyone post some info/links on how to set this up?
Thanks,
|
|
|
|
|
Hi,
I have an MDI application, with five different child forms. (developing in Visual Studio 2008 C# windows Form Application)
I added Serial port to MDI Form.
How can I use that serial port instance (created on MDI Form) on a child Form?
Thanks
Karmu
|
|
|
|
|
I think you should create methods for using serial port on MDI form and call them from the child form. You can find the MDI form from child form using child's MdiParent property.
|
|
|
|
|
hi,
im trying to make an alarm that will just alert in a specified time lenght. Mean it will have 2 parts, First start Time and second End Time. Hope you got my question. I wrote code but it just work till end time is less than 00:00.
For example
If StartTime is 23:00:00 and EndTime is 23:59:00, it will work
but if StartTime is 23:00:00 and EndTime is 01:00:00, it wont
here is the code
DateTime StartTime = new DateTime(1, 1, 1, 23, 52, 40);
DateTime EndTime = new DateTime(1, 1, 1, 1, 01, 10);
if (DateTime.Now.TimeOfDay.CompareTo(StartTime.TimeOfDay) > 0 && DateTime.Now.TimeOfDay.CompareTo(EndTime.TimeOfDay) < 0)
{
MessageBox.Show("Came");
}
i know DateTime.Now.TimeOfDay.CompareTo(StartTime.TimeOfDay) returns 1 if the time is less than 00:00:00 and greater than the parameter TimeSpan else -1
but i'm not getting any idea since mind is very tired because of lots of proccess
i thought to place a bool variable when that time past but problem is that what if user open the pc when time is 1:00:00 then it wont work
any idea guys ?
thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
You are just being far too specific in your comparison. Just compare the DateTime values, i.e. the date and the time of day.
Something like this:
DateTime EndTime = DateTime.Now.AddHours(1);
if (EndTime.CompareTo(DateTime.Now) < 0){
MessageBox.Show("Came");
}
[EDIT: My initial code fragment was rubbish. It make sense now! ]
Alan.
modified on Sunday, December 7, 2008 5:28 PM
|
|
|
|
|
dude, you misunderstood my question. I want comparision in time not with date and time. I do not need date, just time.
for example :
if user open the computer between 23:00 - 01:00 then shows a message to him/her. but problem is 00:00 as i told in first post
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
One way is to split the logic. Something like:
- if the end time > start time, simple check if current time is between start and end
- if the end time < start time it means that you're crossing midnight, then:
- check if current time > start time => alarm
- or if current time < end time, => alarm
|
|
|
|
|
wo wo wo looks like it gonna work...
dude, i always get stucked when i reaches to 00:00 i dunno but brain got flush, something like this hehe well thanks dude
you deserve for a good rate
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Xmen wrote: thanks dude
You're welcome
|
|
|
|
|
Hi every one...can u help me in disabling the border of the group box
thnx in advance,
nagendra kumar
|
|
|
|
|
well, i dont think its good idea to remove its border. You can try panel or just put controls above group box(not in groupbox) and just set its Visible prop. to False.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
If you set visible to false, everything it contains will also be invisible.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
dude, read the post again
"just put controls above group box(not in groupbox) "
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
You're going to have to paint the border yourself.
It might be better to use a Panel control instead of a GroupBox if you want the container functionality but without the border.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
how can i let my application work with plugins (i mean self-written plugins only for that application). I know i can do this with "Reflection", but how can i work with plugins, which should work on mac, linux and so on? Something like the Widgets/Gadgets in Windows-Sidebar, where i have a file, which is a zip-file where the code and so on is inside? How does something like that works?
Has anybody a idea how to do this? Well, i don't want to create a "new programming language" for this plugins, the most plugins like this use javascript, but first, how do i run them? How can i use individual Functions and so on?
Thanks
|
|
|
|
|
the easy way to do this is to add an instance variable of the WebBrowser class and let it execute a page containing the JavaScript. See the sample code for WebBrowser.ObjectForScripting on MSDN:
WebBrowser.ObjectForScripting
This method works fine as long as you can host the WebBrowser control inside a form in your application. Regarding the packaging of your plugins, personally I like the widget concept (as I have to deal with it on a daily basis for a project I am working on). A widget is basically a ZIP file with a certain structure and a manifest file. The manifest file (called config.xml if you follow the w3c standards) points to the main HTML file to execute.
Let me know if you need more help or want more thoughts regarding this.
Cheers,
Marcelo
|
|
|
|