|
|
Hi everybody,
i m new in vb.net. I am writing a an ASP.net application with codebehind in vb. I need to find a word in a multiline textbox filled from a table and then point to it or select it in the textbox so the user could see it. to find it is position. SERVICE is the textbox(multine) FINDTXT is a textbox containing the string to be fetched in the multine textbox
r = SERVICE.Text.IndexOf(FINDTXT.Text)
If r > 0 Then
tst.Text = "Found word, " & r & " characters into the search string."
Else
tst.Text = "Sorry, could not find the search text"
End If
but there is no features that seems to point or select the found text.
If anyone can help I d be more than gratefull
Sabinette!!!
|
|
|
|
|
hi
hope this will help you
Dim index As Integer = TextBox1.Text.IndexOf(strSearch)
TextBox1.Select()
If index <> -1 Then
TextBox1.Select(index, strSearch.Length)
End If
Tamimi - Code
|
|
|
|
|
Thank you for your answer.
however, this only works in windows form in webforms textboxes do not have any type of select property and that 's why i was stuck.
If you know any workaround I d be grateful
Sabinette
|
|
|
|
|
hi,
how can we import data from an excel file to dataset using VB.Net
can u send the code
can u help me
|
|
|
|
|
Something like this:
Dim DS As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim MyConnection As System.Data.OleDb.OleDbConnection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\myData.XLS; " & _
"Extended Properties=Excel 8.0;")
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [Sheet1$]", MyConnection)
DS = New System.Data.DataSet()
MyCommand.Fill(DS)
MyConnection.Close()
NOTE: You will need to provide the correct Excel version for the Extended Properties Value. Needs reference to System and System.Data Namespaces.
To reference the complete used range of a worksheet, specify the sheet name followed by a dollar sign:
select * from [Sheet1$]
To reference a specific range of addresses on a worksheet, specify the sheet name followed by a dollar sign and the range:
select * from [Sheet1$A1:B10]
To reference a named range, use the name of the range:
select * from [MyNamedRange]
If you need to retrieve worksheet formulae, you will need to use Excel automation.
Steve
|
|
|
|
|
thanks a lot.
how can we save these dataset values to a a database
|
|
|
|
|
Do you need to create a new table each time you import this data or is there a table that needs to be updated with the new data?
Steve
|
|
|
|
|
hi,
thanks
i have an existing table.
i want to add the excel data to the existing table .
|
|
|
|
|
I'm having trouble when I want to retrieve password from my user table.
I have web application and windows application sharing the same user table.
I store the password in the user table using the function :
FormsAuthentication.HashPasswordForStoringInConfigFile
and now I want to retrieve the decrypted password using the windows form.
is there is anyone who can tell me what function should I use?
thanks in advance
agus_f
|
|
|
|
|
You cannot decrypt a hashed password.
The method to use is to compare the password entered by the user with the hashed password in your database. When the user enters a password, hash it and compare that hashed value with the values in your database to authenticate your user.
Steve
|
|
|
|
|
thanks steve,
if I can't decrypt a hashed password, how can I compare that password to the decrypted password using windows form?
when storing the password I was using the web form (another application) function hashpasswordforstoringinconfigfile
sorry i'm just a beginer in vb.net
many thanks
agus_f
I'm Just Nothing
|
|
|
|
|
Sorry fro the delay, I have been on a short vacation.
hashpasswordforstoringinconfigfile uses the 'sha1' or 'MD5' hashing algorithms. You need to use the same algorithm to hash the password in your windows form and then compare it to the hashed value stored in your gonfig file or database.
There is an article on this forum that describes various methods for dealing with passwords.
Steve
|
|
|
|
|
Hi all,
I have to modify a VB6 program and I want to access to a const declared in a DLL from the app. I've tried to declare it as public inside the library but the application reports an error cause it doesn't recognize the constant. How can I do that?
Thaks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
OK, it's been 6 years since I've used VB6, so I'm pretty much guessing here.
If a const is declared in a .DLL, just using the name of that constant in your code won't work. You can use it in certain cases, but it depends on how and where the constant is declared in the .DLL. If it's inside a class, then you can probably use it like this:
x = classname.constantname
Without seeing how the constant is declared and what you did to reference this DLL, it's pretty much impossible to give you an accurate answer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
first of all:
- i Want than one cell range have textFormat, cos when i take data from database if the value is 0004 appears like 4 and i want to appear 004
Second and last question.
how can insert images from my computer on excel
thanks for all
Dios creo un equipo perfecto a los demas los lleno de extranjeros
|
|
|
|
|
hi
i ve designed an application in which whenever i enter an amount in a textbox,then that amount will be displaced in the word format of the currency in another textbox.
Eg. if i enter 12225 then it will display as " twelve thousand and two hundred twenty five only"
please help me in this regard.
u can mail me at pradipta_pkc@indiatimes.com
thanks in advance
i m pradip kumar from india,working in vb.net & asp.net
|
|
|
|
|
Hi
if you want to display number to words!! write to me I will help you.
Kanniah
|
|
|
|
|
hi
thanks for the reply
i want the code in vb.net format.i already ve a code in vb but it z nt compitable with vb.net.
it will ve very helpful to me if u send me the said code in vb.net format
thanks in advance
i m pradip kumar from india,working in vb.net & asp.net
|
|
|
|
|
This is one of the most ubiquitous homework assignments.
All you have to do is Google for "convert number to words[^]" and you'll come up with all kinds of examples on how to do it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Please i want your help with a code which i can use to store the system clock in a variable which i can use to add a 30 mints to it. as i want to my application to be shutdown after 30 mints when i click Start button but if the user click End button in another form then the timing should stop , and using the timer control was not helpful becuase it dose not accept any compare condition and just close the application.
so i thought to ignore the timer control and use a code which i can store the system clock in a variable and insert that varialbe in a loop and inside the loop i compare the variable with specific value, if it is the desired value then close the application else go again and read the system clock , DO u think its good thinking. if u think its applicale , please help me a code to store the system clock in a variable.
please advise and thank u for ur help
Ali
|
|
|
|
|
Hi
You have got it wrong! Declare a Public variable something like
Public MyHalfAnHour as Integer
If you have set the timer control as 1 minute. Keep incrementing the above variable in the timer control event and when the incremented value is 30, it means that 30 hour has lapsed and close the application else leave the application as it is.
2. When the user clicks the end button on the second form initialize the variable.
I hope it helps!!!
Kanniah
|
|
|
|
|
Thank you so much , this is really a very smart idea
|
|
|
|
|
Dim StartTime As DateTime = DateTime.Now()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have set white color as the transparent key of my form,
It show properly.
After I chnaged the opacity of the form,
The white color is shown, how can I make the form with this two effect?
That is, opacity = 0.5 and the white color is transparent?
Thank you.
|
|
|
|