|
Dispose cleans up resources. The GC clears the memory. But, it does this in a highly optimised way, automatically. Callnig it yourself is pretty close to always just going to slow things down
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 )
|
|
|
|
|
Okay thanks, that is really good to know. And thanks for the help.
Cheers,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hey Guys
I have problem inserting single and double quotes in DB
How can i insert single Quote and Double Quotes in DB
Can You provide me a simple code for that
Regards
Ramy
|
|
|
|
|
hi, use this one
q = "select * from main where lotnumber like " & """" & ComboBoxlotnumber.Text.Trim & "%" & """"
here ComboBoxlotnumber.Text.Trim may contain single & double quotes
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Apostrophes inside a string in SQL has to be encoded, and depending on what database you are using, backslashes also. There is nothing special about quotes in a string, so if you have problem with them, there is something else that you are doing wrong.
For MySQL: Replace "\" with "\\" and replace "'" with "\'" (in that order).
For MSSQL, Access: Replace "'" with "''".
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi!
Please help me how to disable and enable Task Manager in vb.net.
Best Regard
Jayson
More problems
More Knowledge to gain
Just keep on going
|
|
|
|
|
You really can't, and I can't imagine a non hostile reason for wanting to.
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 )
|
|
|
|
|
Hi
It is not possible ... but command for running it is taskmgr.exe.. Just try out to stop this process using this command
Harini
|
|
|
|
|
It can be done through Group Policy, not through your code. Unless you're building a kiosk machine, there's really no reason to do this.
Get your hands on the Windows XP or Windows Server 2003 Resource Kit (from Amazon) and either of those nice thick books will explain what Group Policies are and how they work in different networking or non-networked environments.
|
|
|
|
|
hi,
I want to know the Path of the Parent folder of Particular File/Folder. How can i achieve this thing in VB.net.
Thanks in Advance
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
|
How do i convert Excel database file to Sql server database file dynamically?
Cynara
|
|
|
|
|
If you mean getting the data from an Excel spreadsheet into SQL Server, where the spreadsheet is in a known format, I would read the data from your spreadsheet a line at a time and check for errors, then insert using an SQL Statement.
If this isn't what you were getting at, feel free to provide more information.
-------------------------------------------------
Damian - <insert something="" useful="" here="">
|
|
|
|
|
Excel is not a database, not even remotely.
You can control Excel using C# code, if you get the Microsoft libraries to do this, and you have Excel installed. Then you can read spreadsheet values and write SQL to put them into any database or other format you like.
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 )
|
|
|
|
|
How do i convert Excel database file to Sql server database file dynamically?
|
|
|
|
|
hello frnds,
i want to convert RTF document to HTML document in vb.net 2.0
if any one have code, then plzzzz give me
thankx in advance/Best Regards
-koolprasad2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
It Depends on what you are actually trying to do.
Does the RTF document contain ready HTML code, and you only need to convert it, or do you just want to insert text from the RTF document into an HTML document?
If it contains ready HTML code you could just try
file.Move("yourHTMLfile.rtf", "yourHTMLfile.html")
Otherwise you'll have to read through both documents, combine the text from the RTF document with the code from the HTML document, and then create a new HTML document from the combined data.
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Dear frnd Johan,
thankx for your valuable advice,
but my rtf file contain plain text and how can i convert the file in to HTML file,
if know the code,then plzzz..give it to me,
once again THANKX,
best regards,
-koolprasad2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
Hi,
I am just not exactly sure what it is that you are trying to do, so I am guessing that you want to insert the text from your rtf file into a web page consisting of html code. Something along the lines of:
Text in the RTF file:
The quick Brown Fox Jumped Over The Lazy Dog
Content of the (empty) HTML file:
<br />
<html><br />
<head><br />
< title>blablabla< /title><br />
</head><br />
<body><br />
<br />
</body><br />
</html><br />
The text would need to be inserted between the body tags.
Is this what you are trying to accomplish?
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Let me clear every point to you,
I have a RTF file at (bla bla ) location
and i just want to convert that file in to html file.
if i am directly save the file as HTML then all the content are display in binary format,
so how can i convert the .RTF file in to .HTML file
Clear ???
I am using vb.net 2.0
best regards,
-koolprasad2003
Life is very beautiful... Life is swing with you..Enjoy..
|
|
|
|
|
One thing you could try is to read the contents of the rtf file with a streamreader and then use a streamwriter to write the data into a new html file.
Something like this:
<br />
Dim sr As StreamReader = New StreamReader("Your_RTF_file.rtf")<br />
Dim sw As StreamWriter = New StreamWriter("Your_HTML_file.html")<br />
Dim line As String<br />
Dim content As String<br />
'read data from file<br />
Do<br />
line = sr.ReadLine()<br />
If line Is Nothing Then Exit Do<br />
content += line<br />
Loop Until line Is Nothing<br />
'write data to file<br />
sw.WriteLine(content)<br />
sw.Close()<br />
Otherwise my experience with file conversion is limited, sorry.
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I was trying to make a text to speech program .for that i am writing the following code.
Public Class Form1<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
If (TextBox1.Text.Trim <> "") Then<br />
TextBox1.Text = CType(TextBox1.Text.Trim, Integer)<br />
Dim no As Integer = CType(TextBox1.Text.Length, Integer)<br />
If (no <= 0) Then Exit Sub<br />
Select Case no<br />
Case 1<br />
MessageBox.Show(ones(TextBox1.Text))<br />
Case 2<br />
MessageBox.Show(tens(TextBox1.Text))<br />
Case 3<br />
MessageBox.Show(Hundered(TextBox1.Text))<br />
Case 4<br />
MessageBox.Show(Thousand(TextBox1.Text))<br />
Case 5<br />
MessageBox.Show(TenThousand(TextBox1.Text))<br />
Case 6<br />
MessageBox.Show(Lakh(TextBox1.Text))<br />
Case 7<br />
MessageBox.Show(TenLakh(TextBox1.Text))<br />
Case 8<br />
MessageBox.Show(Crore(TextBox1.Text))<br />
Case 9<br />
MessageBox.Show(tenCrore(TextBox1.Text))<br />
End Select<br />
End If<br />
End Sub<br />
<br />
Private Function tenCrore(ByVal digit As String) As String<br />
Dim str As String = ""<br />
If (Not CInt(digit.Substring(0, 2)) = 0) Then<br />
str = tens(digit.Substring(0, 2)) & " Crore "<br />
End If<br />
If (Not CInt(digit.Substring(2, 7)) = 0) Then<br />
Return str & TenLakh(digit.Substring(2, 7))<br />
Else<br />
Return str<br />
End If<br />
End Function <br />
<br />
Private Function Crore(ByVal digit As String) As String<br />
Dim str As String = ""<br />
If (Not CInt(digit.Substring(0, 1)) = 0) Then<br />
str = ones(digit.Substring(0, 1)) & " Crore "<br />
End If<br />
If (Not CInt(digit.Substring(1, 7)) = 0) Then<br />
Return str & TenLakh(digit.Substring(1, 7))<br />
Else<br />
Return str<br />
End If<br />
End Function<br />
<br />
Private Function TenLakh(ByVal digit As String) As String<br />
Dim str As String = ""<br />
If (Not CInt(digit.Substring(0, 2)) = 0) Then<br />
str = tens(digit.Substring(0, 2)) & " Lakh "<br />
End If<br />
If (Not CInt(digit.Substring(2, 5)) = 0) Then<br />
Return str & TenThousand(digit.Substring(2, 5))<br />
Else<br />
Return str<br />
End If<br />
End Function<br />
<br />
Private Function Lakh(ByVal digit As String) As String<br />
Dim str As String = CType(digit, String)<br />
Return ones(str.Substring(0, 1)) & " Lakh " & TenThousand(str.Substring(1, 5))<br />
End Function<br />
<br />
Private Function TenThousand(ByVal digit As String) As String<br />
Dim str As String = ""<br />
If (Not CInt(digit.Substring(0, 2)) = 0) Then<br />
str = tens(digit.Substring(0, 2)) & " Thousand "<br />
End If<br />
If (Not CInt(digit.Substring(2, 3)) = 0) Then<br />
Return str & Hundered(digit.Substring(2, 3))<br />
Else<br />
Return str<br />
End If<br />
End Function<br />
<br />
Private Function Thousand(ByVal digit As String) As String<br />
Dim str As String = ""<br />
If (Not CInt(digit.Substring(0, 1)) = 0) Then<br />
str = ones(digit.Substring(0, 1)) & " Thousand "<br />
End If<br />
If (Not CInt(digit.Substring(1, 3)) = 0) Then<br />
Return str & Hundered(digit.Substring(1, 3))<br />
Else<br />
Return str<br />
End If<br />
<br />
' Return ones(str.Substring(0, 1)) & " Thousand " & Hundered(str.Substring(1, 3))<br />
End Function<br />
<br />
Private Function Hundered(ByVal digit As String) As String<br />
Dim str As String = ""<br />
If (CInt(digit.Substring(0, 1) > 0)) Then<br />
str = ones(digit.Substring(0, 1)) & " Hundred "<br />
End If<br />
If (CInt(digit.Substring(1, 2) > 0)) Then<br />
If (CInt(digit.Substring(1, 2)).ToString.Length = 1) Then<br />
Return (str & " " & ones(digit.Substring(1, 2)))<br />
Else<br />
Return (str & " " & tens(digit.Substring(1, 2)))<br />
End If<br />
<br />
<br />
Else<br />
Return str<br />
End If<br />
End Function<br />
<br />
Private Function tens(ByVal digit As String) As String<br />
Dim digt As Integer = Convert.ToInt32(digit)<br />
Dim name As String = ""<br />
Select Case (digt)<br />
Case 10<br />
name = "Ten"<br />
Case 11<br />
name = "Eleven"<br />
Exit Select<br />
Case 12<br />
name = "Twelve"<br />
Exit Select<br />
Case 13<br />
name = "Thrirteen"<br />
Exit Select<br />
Case 14<br />
name = "Fourteen"<br />
Exit Select<br />
Case 15<br />
name = "Fifteen"<br />
Exit Select<br />
Case 16<br />
name = "Sixteen"<br />
Exit Select<br />
Case 17<br />
name = "Seventeen"<br />
Exit Select<br />
Case 18<br />
name = "Eighteen"<br />
Exit Select<br />
Case 19<br />
name = "Nineteen"<br />
Exit Select<br />
Case 20<br />
name = "Twenty"<br />
Exit Select<br />
Case 30<br />
name = "Thity"<br />
Exit Select<br />
Case 40<br />
name = "Fourty"<br />
Exit Select<br />
Case 50<br />
name = "Fifty"<br />
Exit Select<br />
Case 60<br />
name = "Sixty"<br />
Exit Select<br />
Case 70<br />
name = "Seventy"<br />
Exit Select<br />
Case 80<br />
name = "Eighty"<br />
Exit Select<br />
Case 90<br />
name = "Ninty"<br />
Exit Select<br />
Case Is > 20<br />
Dim str As String = CType(digit, String)<br />
name = tens(str.Substring(0, 1) & "0") & " " & ones(str.Substring(1, 1))<br />
End Select<br />
Return name<br />
End Function<br />
<br />
Private Function ones(ByVal digit As String) As String<br />
<br />
Dim digt As Integer = Convert.ToInt32(digit)<br />
Dim name As String = ""<br />
Select Case (digt)<br />
Case 0<br />
name = "Zero"<br />
Case 1<br />
name = "One"<br />
Exit Select<br />
Case 2<br />
name = "Two"<br />
Exit Select<br />
Case 3<br />
name = "Three"<br />
Exit Select<br />
Case 4<br />
name = "Four"<br />
Exit Select<br />
Case 5<br />
name = "Five"<br />
Exit Select<br />
Case 6<br />
name = "Six"<br />
Exit Select<br />
Case 7<br />
name = "Seven"<br />
Exit Select<br />
Case 8<br />
name = "Eight"<br />
Exit Select<br />
Case 9<br />
name = "Nine"<br />
Exit Select<br />
End Select<br />
Return name<br />
End Function<br />
<br />
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress<br />
If (e.KeyChar = "1" Or e.KeyChar = "2" Or e.KeyChar = "3" Or e.KeyChar = "4" _<br />
Or e.KeyChar = "5" Or e.KeyChar = "6" Or e.KeyChar = "7" Or e.KeyChar = "8" _<br />
Or e.KeyChar = "9" Or e.KeyChar = "0" Or e.KeyChar = Chr(Keys.Back)) Then<br />
e.Handled = False<br />
Else<br />
e.Handled = True<br />
End If<br />
End Sub<br />
End Class
for text to speech i was thinking to create a audio files for each of the following numbers.
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,30,40,50,60,70,80,90
Now My Question is
1. Am I think right to create the audio files for each of the above numbers ?
2. Which audio extention file(.wav , mp3 .. etc ) will be useful .I meant which takes less space.
|
|
|
|
|
You also need speech for the words "and, hundred, thousand, million" etc
re: Wav or MP3 - by definition MP3 files will be smaller as it is a compressed format, but for such small files it probably doesn't make much difference. Go with wav for simplicity I say...
-------------------------------------------------
Damian - really needs to create a signature
|
|
|
|
|
Is there any way to reduce the code?
|
|
|
|
|