|
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?
|
|
|
|
|
Probably, but unless you are willing to pay me I'm not going to do that for you.
|
|
|
|
|
wow - no-one is going to read all that.
1 - yes, you can do that
2 - well, create a wav, encode it to mp3, and see which is smaller... MP3 is obviously smaller. I believe WMA is smaller still, but they are probably quite similar.
Yes, this code is very brute force, there's no doubt you could make it a lot smaller and more elegant.
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 )
|
|
|
|
|
Sir, Please Provide me some tips how can i reduce the code.
Along with the code i am going to create audio file - for each words
0,1,2,3,4,5,6,7,8,9,10,12,11,13,14,15,16,17,18,19,20,30,40,50,60,70,80,90,
hundred , thousand, ten thousand, lakh, core,ten crore.
Another question is that Is there any way out to reduce the audio files .i thought to create as many audio files as i said above.
Am i thinking right?
Please provide some suggestions.
|
|
|
|
|
Build a dictionary that you can use to look up file names based on numbers instead of all those switch statements, for a start.
Nilish wrote: Another question is that Is there any way out to reduce the audio files
Not really, I don't think.
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 should I built the dictionary?
|
|
|
|
|
Why not just use the SAPI 5.1[^] API library??
|
|
|
|
|
hi,
i have two buttons in my form - named button1 and button2.now in the following handler , can i add the two button click events?
like
private sub button_click(byval sender as system.objects , byval e as system.eventargs)handles button1.click , button2.click
end sub
|
|
|
|
|
If clicking the two buttons causes the same code to execute, why do you need two buttons?
-------------------------------------------
Damian - Man of changing signature.
|
|
|
|
|
No, further i want to do code to distinguish between two button , whether i have clicked button1 or button2 .Is it possible???????
|
|
|
|
|
|