|
yeah, now add .fff to the format string to get fractions of a second.
|
|
|
|
|
I m using Visual Studio 2005. How can I drag and Drop Table From Data Connection Node of Server Explorer to Form. I have done it n Visual Studio 2003. But I m not able to do this in 2005. Does VS 2005 does not support it, or ther s a special method for that.
Thanks in Advance
|
|
|
|
|
Not sure about whole tables. I drag and drop fields from tables and views with no problem...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
hi
i am doing a project in which creating log files for the users signed on . its automated input process so i will be writing each and every input in log file .
log file is a .txt file i am appening the file using streamwriter
at the same time i am trying with another button to read the file using stram reader or any io.files.readalllines() but its not allowing to read. how i can read the file while some strea writes into it. please any one tell me this. i cannot close the stream each and every time as the process is automated for testing purpose.
with regards
Balagurunathan.B
|
|
|
|
|
What you want to do is impossible. You absolutely need to close the stream, in order to read it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
but my doubt is if you r opening and editing a word document and on the same time if some other user on network trys to read they can open in read only mode and can read lastly saved one then why can us do the same programatically
thanks
with regards
Balagurunathan.B
|
|
|
|
|
Word handles this by creating a temporary file, which is the file that is opened for editing. Read only mode means it reads the entire file, then closes it, it doesn't keep it open.
Open a Word doc, then look in Windows Explorer, you'll see the temporary file there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I beg to differ: whoever creates/opens a file is in control regarding the
operations others can do to the same file.
one can easily share a file between threads and even processes; it suffices
to apply the correct FileShare value when creating/opening the file.
My example shows a first stream writing to a file it allows others to read,
and a second stream reading from same file allowing others everything:
string filename="streamTest.txt";
using(FileStream fw=new FileStream(filename, FileMode.Create,
FileAccess.Write, FileShare.Read)) {
using(StreamWriter tw=new StreamWriter(fw)) {
tw.WriteLine("Created new file");
using(FileStream fr=new FileStream(filename, FileMode.Open,
FileAccess.Read, FileShare.ReadWrite)) {
using(StreamReader tr=new StreamReader(fr)) {
for(int i=0; i<10; i++) {
tw.WriteLine("line "+i);
tw.Flush();
string s=tr.ReadLine();
Console.WriteLine(s);
}
}
}
}
}
BTW the flush is there to undo the buffering that takes place in these streams;
without it there probably would be nothing to read when the short loop
terminates; for longer streams, flushing is not needed ! And normally
the reader should continue to read after the writer has done, my example does not.
PS: sorry for posting a C# example in a VB.NET forum !
|
|
|
|
|
hi Luc Pattyn
but its not working mate
i am appending the string
is it because of that something else
with regards
Balagurunathan.B
|
|
|
|
|
balakpn wrote: not working
please be more specific: if it throws an exception show it; if it runs but
does not produce the expected outcome, please explain.
I did run my example before posting it. Much depends on the FileMode, FileAccess
and FileShare values you use EVERY time the file or filestream gets created/opened.
e.g. the simplest overloads for creatinbg/opening a file (those with default values
for FileShare) would use FileShare.None, disallowing others to touch the file.
|
|
|
|
|
hi
its working fine
i made a minor mistake thts the problem sorry and thanks a lot
with regards
Balagurunathan.B
|
|
|
|
|
|
I am developing ASP.NET Web Application using vb.net One of
the requriement of this application is ...when user submit
the Web Form....it should open the Word Templete and
insert the values into that templete...
Does anybody knows...How to Open and Writes into Word
Document Using ASP.NET and vb.net Directly...i am looking for
specific sample...
Thanks,
|
|
|
|
|
What on earth are you thinking here ?
1 - I told you that ASP.NET isn't going to matter to your solution
2 - I told you what you need in order to do this, all you have to do is google and download it, I'm sure it comes with samples
3 - for all that, I am sure that you're not the first person who wants to do this, there must be countless google hits that will tell you the answer, with code
4 - posting the same question over and over, when the last time you asked is still visible, is just plain annoying, it's not going to leave anyone inclined to answer you any faster.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
OK, well, perhaps you need to write a single, intelligent post that actually outlines what you have done, instead of posting the same vague question over and over ? If what you want to do, occurs on the client side, then it's not going to work in ASP.NET, because the server code is on the server, not on the client.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
One Post is enough.
WHy are you again and again posting the same question.
there itself CG has answered you.
Regards,
Satips.
|
|
|
|
|
Got to love it when instead of taking your advice, they just delete all their posts.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You're mixing types in a horrible way.
BTW, since tot is an Integer , it cannot store a floating point value.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
so what should i do to store float numbers
|
|
|
|
|
Use a float, decimal, or double. The questions you're asking, and the code you're posting, indicate that you should slow down, buy a basic book on VB.NET, and work through it. You should certainly be aware of the horror of VBs loose typing, and be aware of when you're relying on it to make your code work, it can create all sorts of hidden bugs and side effects.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to validate that my textbox contains a numerical value.
I do this in the "textbox.validating" event, everything works fine until all the text is cleared and the box has an empty string. The validation doesn't allow an empty string because it's not numerical (no matter how I code it). But this field is not compulsory for the user to enter, so he should be able to enter either a numerical value or an empty string.
Here is my code so far, it doesn't work for empty strings, textbox remains invalidated and forces focus onto the control.
Private Sub MyMaskedTextBox_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyMaskedTextBox.Validating
Dim num As Double
If Me.MyMaskedTextBox.Text = "" Or IsDBNull(Me.MyMaskedTextBox.Text) Then
MyErrorProvider.SetError(Me.MyMaskedTextBox, "")
Else
Try
num = Me.MyMaskedTextBox.Text
MyErrorProvider.SetError(Me.MyMaskedTextBox, "")
Catch ex As Exception
MyErrorProvider.SetError(Me.MyMaskedTextBox, "Value must be numeric")
End Try
End If
End Sub
This is a real problem because nothing I've tried so far allows the user to enter an empty string!
Can't I somehow force the field to validate even if the contents don't match the validation criteria?
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
The following code may be better
if string.isnullorempty(Me.MyMaskedTextBox.Text) orelse isnumeric(Me.MyMaskedTextBox.Text) then
'Its a number or an empty string
else
'Its got content but is not numeric
end if
|
|
|
|
|
Thank you SHatchard but that code does exactly the same as mine.
The textbox still doesn't validate with an empty string and focus is forced to the control until it validates.
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
This field is databounded to a DB cloumn of the type Double.
It seems that NULL is not accepted by datasets for Double columns.
Eventhough the default value is DBNull (which .Net accepts) and the AllowDBNull property is set to TRUE (which .Net accepts)
The columns NullValue property can only be set to <throw exception="">, .Net rejects all other selections.
I still don't have a solution but this problem starting to look more like a bug in .Net than and not in my code.
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
try to replace
--If Me.MyMaskedTextBox.Text = "" Or IsDBNull(Me.MyMaskedTextBox.Text) Then
with
--if isnothing(Me.MyMaskedTextBox.Text) then
or
--if Me.MyMaskedTextBox.Text is nothing then
if it still doesnt work... may i know what vb are you using?
|
|
|
|