|
Luc Pattyn wrote: which is difficult !
Yes, but powerful if I may add
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Sure, there would be little value in "difficult but not powerful".
Didnt seem to me like a good idea to stear the OP in that direction tho.
If unfamiliar with TryParse, what a question avalanche should we expect
from Regex attempts ?
|
|
|
|
|
Luc Pattyn wrote: Didnt seem to me like a good idea to stear the OP in that direction tho.
Yeah, maybe I did a little overkill on the question :->
Luc Pattyn wrote: If unfamiliar with TryParse, what a question avalanche should we expect
from Regex attempts ?
I'll try to take care of any snowballing that comes from regex questions
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: I'll try to take care of any snowballing that comes from regex questions
Too much spare time ? Or attracted by fixture status ?
|
|
|
|
|
Luc Pattyn wrote: Too much spare time ?
Yes, I have some time right now. Not sure what my time will look like when I start my new job in two weeks
Luc Pattyn wrote: attracted by fixture status ?
I'm almost there :->
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Check out my articles from the link in my signature. Both are on Validation.
|
|
|
|
|
alurora wrote: could anyone help me not to have the form minimise when the error messagebox popup, please?
I'm wondering what you did to make it do that?? I can't duplicate the problem with the code you've posted.
|
|
|
|
|
What??? I was looking through the Validation thread and ran across this orphan. What was the OP talking about as far as minimizing an error messagebox popup? Only thing I could think of is that he didn't mean MessageBox but some custom form that acted as a error messagebox...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
He was saying that his main form would minimize when he put up a MessageBox. I was wondering what he did to accomplish this feat.
|
|
|
|
|
Dave Kreskowiak wrote: I was wondering what he did to accomplish this feat.
That is odd. One way I think he could have done it was by having the code invoke a minimize window message before going to the MessageBox.
"But your mind is too small and simple to understand anything other than fart jokes." - leckey advising a certain troll
|
|
|
|
|
I'm using VB.NET2005. Could anyone here tell me how do I change a date format to simple one, just:ddmmyyyy, and WITHOUT time display, please?
Thank You Very Much. Ryan
|
|
|
|
|
alurora wrote: Could anyone here tell me how do I change a date format to simple one, just:ddmmyyyy, and WITHOUT time display, please?
I presume you have a DateTime object of some sort. It has a ToString() method that takes a formatting string.
e.g. myDateTime.ToString("ddMMyyyy") will give you what you want.
Becareful of the capitalisation mm == minutes and MM == months.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
if it is a datetime object simply:
mystring = mydatetime.ToShortDateString
|
|
|
|
|
Apart from using " " as spacing syntax in vb.net, whether have any other command can represent it?
finalresult += (str_f_data(c)(1) + " " + str_f_data(c)(2) + " " + str_f_data(c)(3) + " " + str_f_data(c)(5))
Whether the space can be overwritten? The length for my array is different (in same column with different length). I want to make them located in same starting position after print out.
-- modified at 12:52 Saturday 28th July, 2007
|
|
|
|
|
You might want to look at the String.Format method.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
|
There are plenty of examples out there, including in the documentation for the .NET Framework. You might want to learn what String.Format() can do rather than copy and paste an example someone made for you. That way the next time you will be able to do it yourself.
Seriously, String.Format() is in just about every good beginners book to .NET or VB.NET
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Dim final_oWrite As System.IO.StreamWriter<br />
final_oWrite = System.IO.File.CreateText(File_result)<br />
<br />
If System.IO.File.Exists(header_File) = True Then<br />
System.IO.File.Copy(header_File, File_result)<br />
End If<br />
<br />
final_oWrite.Close()
I would like to create the text file (File_result) and copy the content from header_File to File_result. It shows the message that file have alreay exists. How to overwrite the existing file.
|
|
|
|
|
use this overload method: File.Copy (String, String, Boolean)
3rd argument is for overwrite.
--------------------------------
txtSignature
|
|
|
|
|
After i put in true inside the bracket and run the program, it show me the message "the process cannot access the file because it is being used by another process.
|
|
|
|
|
That means the file is in use somewheres...
BTW, why do you want to overwrite the file? I was under the impression you want to create a new file and copy contents of another file to it?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
After i copy the file to the new file, i want to append the content again.
|
|
|
|
|
Okay, are you making sure the new file is closed before doing the appending?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
I have a dataset bound to a textbox. I'm using my own stored procs for the dataadapter. The data loads into the textbox, I can edit it and the changes show in the dataset. I am faced with 2 problems:
1. The dataset.haschanges = false. Even though I can see the changes when I access the dataset field in the immediate window.
2. The updatecommand parameter values in the dataadapter are null.
There are no errors. Everything runs, it just doesn't commit the changes to the database.
I can verify that the stored procs work fine. In fact if I put a DataGridView on the form and bind to that everything saves just fine, using the exact same code (apart from binding obviously) and stored procs.
Some code:
Table name: tblScripts
Column name: Script_Desc
Binding the textbox:
TextBox1.DataBindings.Add(New Binding("Text", m_ds, "tblScripts.Script_Desc"))
Update code:
If m_ds.HasChanges() Then
'if i skip into here there are no errors
'but changes do not commit to database
m_da.Update(m_ds, "tblScripts")
End If
Is there something special I need to do when binding a textbox to a dataset which was filled by a dataadapter which uses stored procs?
I'm using Vista with the Visual Studio 2005 Vista patch, is there a known bug by any chance?
Please help, I'm at my wits end!
|
|
|
|
|
Hi,
I am not sure about the rest of your code, but to bind a datasource to a control using simple binding (bind a control to one field) you need to specidy three issues:
-Property Name (e.g. Text)
-DataSource (e.g. DataTable)
-ColumnName
TextBox1.DataBindings.Add("Text", m_ds.DataTable, "ColumnName"))
Note: To apply the changes you need to change the cursor (move fwrd/bkwrd) or call the EndEdit of datarow object.
In addition, I see that you are checking the changes on the DS level, do you have one table only!!?
Also, check the where clause in the update scripts of the Update/Delete Commands of DataAdapter.
hope this helps
|
|
|
|