|
Perhaps you should reply to the original poster instead of to me.
---
single minded; short sighted; long gone;
|
|
|
|
|
please help me ASAP!
Actually i want read a line from 1st text file and search this line in the second text file( which had the string as in 1st txt file and equivalent localized string) and then copy this localized string from 2nd text file and replace with the 1st one.
Thanks in advance!
pankaj kumar
|
|
|
|
|
pankajs3k wrote: please help me ASAP!
I already did....
pankajs3k wrote: Actually i want read a line from 1st text file and search this line in the second text file( which had the string as in 1st txt file and equivalent localized string) and then copy this localized string from 2nd text file and replace with the 1st one.
I repeat - to do this, you need to read the second file into memory, then you can replace parts of it in memory, and overwrite the old file with the new one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 have this code to validate characters and numbers in textbox, i have wrote it in vb 6 now "KeyAscii" is not recognised, tells me that the variable not declared. in vb6 its good help me write the two code in .net
'Accept only Characters refer to code Project
' If KeyAscii < Asc("9") Then
' KeyAscii = 0
'End If
'Accept numbers only refer to code project for Documentation
' If KeyAscii > Asc("9") Then
'KeyAscii = 0
' end if
thanks
Vuyiswa
|
|
|
|
|
Use the KeyChar property of the event argument object that is sent to the event.
---
single minded; short sighted; long gone;
|
|
|
|
|
still give me an Error
Private Sub txtmobile_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtmobile.TextChanged
'Accept numbers only refer to code project for Documentation
If KeyChar > Asc("9") Then
KeyChar = 0
End If
End Sub
Vuyiswa
|
|
|
|
|
I strongly urge you to turn off your computer, go to a bookstore, buy a book on VB.NET, a beginner book that teaches you to code, and not just to play with the shiny wizards. Read it.
You have not taken the advice you were given. The text changed event doesn't just recieve an EventArgs object, it recieves a derived object called somthing like a TextEventArgs, which has a property called KeyChar. You're trying to pull a mythical property out of thin air instead of doing waht you were told.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
The event object in your handler is called "e". You have to do something like this:
If e.KeyCode = Keys.whatever ...
You also cannot do this in the TextChanged event of the TextBox. It doesn't give you th ekey that was hit. You have to use the KeyDown event.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
His e is also still an eventargs object, not a derived one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
tHANK YOU MAN YOU ARE A MAN
Vuyiswa
|
|
|
|
|
The TextChanged event isn't used to handle a key press, so you can not use it to cancel a key. When the TextChanged event is executed, the contents of the text box has already changed.
Use the KeyPress event to handle key presses.
KeyChar is not a global variable, it's a property of the KeyPressEventArgs object. Also, it's not an ASCII code, it's a char.
You would do better to look up the documentation about what you are doing, instead of just guessing.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi there,
Is suppose there is a way to select or set a different tray on a printer when printing from visual basic 6? How do i do that?
Thank for your time.
Regards, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
Hi there,
Thanks for your time. I've figure it out. It's easy, use the PaperBin property of the Printer Class to specify the tray to use.
Regards, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
suppose , i have to return a value from an integer type return function.
I have got two ways to return the value......, which i have mentioned in the function .
Which will be more appropriate and less memory consuming ,,, something sort of that point of view.
Private function abc()as integer
return 1
if(a="")then
abc=1
exit function
end if
end function
|
|
|
|
|
A function should have a single return statement, at the bottom. Don't worry about memory, you're talking about returning an integer.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 was talking about which case should i consider ?
latter one or former one ????????
|
|
|
|
|
The latter is typical VB nastiness, so I'd go with the former for that reason. Memory wise, I doubt it makes any difference.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 was reading the records from the database , around 250 records
I used both the datareader and the dataset.
and in both cases , i am facing the same problem , after an uncertain records or period of time.
and the problem is an error that gets occured . An Unspecified Error
Even while using dataset this problem persist(I mean dataset closes the connection with the database after reading the records in bulk.).One thing is that i know , datareader does not closes the connection until the record fetching is completed , on the other hand , dataset closes the database connection after filing the adapter.
Help.......
-- modified at 2:33 Monday 7th May, 2007
|
|
|
|
|
Nilish wrote: I mean dataset closes the connection with the database after reading the records in bulk
Actually, no. The DataSet knows nothing about the connection at all. It is the DataAdapter that opens and closes the connection.
Nilish wrote: and in both cases , i am facing the same problem , after an uncertain records or period of time.
and the problem is an error that gets occured . An Unspecified Error
Then the problem is most likely not to do with the DataReader Vs. DataAdapter, but something else. Where in the code does it fail? What are the relevant values of the variables and properties just prior to the failure.
|
|
|
|
|
the oledbconnection variable automatically get equal to nothing , when there arise an error An Unexpected Error
when i try to reassign the memory , it don't accept .until i get out of debug mode.
i am using the followinf code
dim con as new oledbconnection("connectionsting")
con.open
dim cmd as new oledbcommand("query",con)
dim dr as oledbdatareader=cmd.executereader
while(dr.read)
.................
.................
end while
Problem occurs at memory allocation to connection variable.
once the problem comes , it persist until i quit from the debug mode.
Problem does not come at first time execution of above code.the code is under button and prolem come after 10th button click
Help..................
|
|
|
|
|
You have to close the data reader and the connection when you are done with them. If you don't do that, the connection will remain in memory still connected to the database. When the connection pool is full of live connections, you can't create any more connections until one of the connections time out by itself, or until you restart the application (which is what happens when you quit from debug mode).
---
single minded; short sighted; long gone;
|
|
|
|
|
if dataset is taken .even then i am facing the problem.
-- modified at 6:37 Monday 7th May, 2007
|
|
|
|
|
I need your help to create a simple routine to add records (new users) to my tblUsers in an Access database. tblUsers has 3 fields = userName, password, accessLevel. I have tried to use an insert command, but nothing happens. I am lost. Any suggestions would be greatly appreciated! TIA
IT
|
|
|
|
|
IvanIT wrote: I have tried to use an insert command, but nothing happens.
"Nothing" rarely ever happens. What does happen? Have you verified that your code runs at all? Are you sure that the code actually executes the query? Do you get any error message?
An update query can execute without actually doing any updates, but an insert query never executes successfully without doing an insert (unless of course you make an "insert ... select ..." where the select query returns an empty result).
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi!
I have posted this several times but this time. may be its not clear what i want so below is the code
Dim ppItem As Microsoft.Office.Interop.PowerPoint.Shape
If Len(Trim(dr.Item(Strings.Right(Trim(ppItem.TextFrame.TextRange.Text), Len(Trim(ppItem.TextFrame.TextRange.Text)) - 1)))) > 0 Then
Dim s As String = dr.Item(Strings.Right(Trim(ppItem.TextFrame.TextRange.Text), Len(Trim(ppItem.TextFrame.TextRange.Text)) - 1))
s = s.Trim
ppItem.TextFrame.TextRange.Text = s
'ppItem.TextFrame.TextRange.Font.Bold = Microsoft.Office.Core.MsoTriState.msoFalse
'========================
Dim a, b, looplen As Integer
looplen = s.Length
Dim hashWords As String()
Dim strWord As String
For a = 0 To looplen - 1
If s.Substring(a, 1) = "#" Then
a += 1
For b = 1 To looplen - 1
If s.Substring(a, 1) = "#" Then
ppItem.TextFrame.TextRange.Text = strWord
ppItem.Select(Microsoft.Office.Core.MsoTriState.msoCTrue)
ppItem.TextFrame.TextRange.Font.Bold = Microsoft.Office.Core.MsoTriState.msoCTrue
strWord = ""
Exit For
End If
strWord += s.Substring(a, 1)
a += 1
Next
Else
ppItem.TextFrame.TextRange.Font.Bold = Microsoft.Office.Core.MsoTriState.msoFalse
End If
Next
In above code i want all the strings send to powerpoint and make strWord bold.
could someone please help me or just give me a clue I am having really hard time to fix it
thanks
|
|
|
|