|
use string.Replace("'", "''") to fix your strings,or just use stored procs, or parameterised queries, which do this for you.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If you're using SQL Server, use SqlParameter. You won't have problems with special characters and you won't leave open to sql injections. See: SqlParameter[^]
modified on Saturday, December 20, 2008 6:45 AM
|
|
|
|
|
Hi,
i have to validate my password with this rules
1.i can enter any alpha numeric charcter
2.I can enter anything in a valid speical character set
so i write my regular expression like this
[a-zA-Z0-9 + strspecialCharacterString +]
and to avoid special meaning of speical character i am adding \ in front of every special
character.Now my problem in wen i use an _ in my pattern ie some thing like "*_<" it is not
working.It throws an error below
"parsing "[\*\_\<]" - Unrecognized escape sequence \_."
if i give \\ instead of \ it is working.can any body help me in sorting out this problem?
Thanks in advance
shally
sdf
|
|
|
|
|
Hi,
The underscore character is not a special character inside a regex, so it should NOT be escaped by
a backslash; and when you prefix it by two backslashes, you are actually adding a single backslash
to the list of acceptable characters.
|
|
|
|
|
hi,
Thanks a lot for your my answer.But i have one doubt.Why error is throwing only if we use underscore character."!,@,:" etc are not special character.But if i use them in my pattern no error is throwing. Why is it like this?
Shally
sdf
|
|
|
|
|
These are the characters that have a special meaning in a regex expression:
$ ^ { [ ( | ) * + ? \
If you need one of them literally, then you must escape it with a backslash;
all other characters (including _ ! @ : ) are regular characters, just like a thru z and 0 thru 9.
|
|
|
|
|
Hi all...
I am using VS2005. I am trying to execute a URL as follows :
process.start("URL path here")
This start the website.. But I want to open this URL but in hide mode..
So that when it wil open URL it, will not visible to user.
Please suggest me how can I do this.
Thanks.
Gagan
|
|
|
|
|
I'm not sure there's a way to do that. Why would you want to run a URL invisibly ? your best bet to do that is to put an invisible web control on your form and open the page there.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
this may help u
Dim p1 As New System.Diagnostics.Process
p1.StartInfo.WindowStyle = ProcessWindowStyle.Normal
p1.StartInfo.FileName = "C:\Program Files\Internet Explorer\iexplore.exe"
p1.StartInfo.Arguments = "yahoo.com"
p1.StartInfo.UseShellExecute = True
p1.Start()
'p1.WaitForExit()
p1.Close()
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Why ? How does it hide the window ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
OK
Sorry
replace the line
p1.StartInfo.WindowStyle = ProcessWindowStyle.Normal
with
p1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I have already tried using
p1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
but it is opening web page in normal mode not in hidden mode..
Please help me...
Thanks.
Gagan
|
|
|
|
|
but here am getting....
can u paste the total method , u r write..........
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I have created and included an activex component that is embedded in an aspx page using <object classid="http:mybin/bydll.dll#method<br" mode="hold">
Everthing works fine on some machines. However, I have two client machines running windows xp and ie 7, that will not download the activex control.
I have modified the .Net zones appropriately to use FullTrust (trusted sites and internet(for testing purposes).
I have modified the browser security settings to allow active x controls to be downloaded.
For a few machines, this download does not work. Does anyone have any ideas as to what I can check, read, test to understand why a download is not taking place on a few machines?
Thanks
|
|
|
|
|
Are they the only machines that have IE7 that you've tested on ? Sounds like IE7 has made things tighter and you can't get through.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks for the reply. All of the machines that it has successfully downloaded the control to have been on IE7. I have adjusted security settings in both the .NET configuration tool and the browser, but to no avail on the two machines I am having a problem with.
|
|
|
|
|
VB6: I have a picture on form and I currently have code that will allow the mousewheel scroll the picture up and down, but I am not sure how to set a limit or how to prevent the picture from scrolling out of view. Below is my code, any suggestions:
'**************************************
Private Sub ProcessMessages()Dim Message As Msg
Do While Not bCancel
WaitMessage
If PeekMessage(Message, Me.hWnd, WM_MOUSEWHEEL, WM_MOUSEWHEEL, PM_REMOVE) Then
If Message.wParam < 0 Then
Picture1.Top = Picture1.Top + 240
Else
Picture1.Top = Picture1.Top - 240
End If
End If
DoEventsLoop
End Sub
'**************************************</pre>
<div class="ForumSig">YOYO</div>
|
|
|
|
|
Soooo, how many times a day are you going to ask this question? How long before you relize that it's very unlikely you're going to get an answer to it?? I for one, haven't used VB6 in 7 years.
|
|
|
|
|
What is this the 3rd or 4th time today? I mean I understood the second repost because the way he formatted his code was horrific, but now someone is desperately just avoiding google and alternative methods of research.
Stop the reposting, no one here is obligated to help you, and if they didn't by now, chances are it isn't going to happen.
|
|
|
|
|
VB6 is dead and was always a joke. Why are you using it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi everybody,
I'm VERY new to VB and need some guidance...it may be that I am just over complicating things by what I'm doing though - or what I am asking might not be possible - but here goes!!
I am writing a new app from scratch for my current employers and I have a few classes that are used to handle data access and management.
I have a class that represents a "Shop", so it has a shop number, address lines etc.
I have a seperate class called "Shops" which inherits from CollectionBase. The Items in Shops.List are populated by "Shop" objects. So I have a method called populatelist which uses a SqlDataReader to return a list of customer shops. I then traverse this list and create a "Shop" using field values in each datarow. I then Add(Shop) which populates my collection list.
This all seems to work fine.
However I want to connect my "Shops" collection to a combobox, so I tried code like the following: -
Dim aBind As New BindingSource
aBind.DataSource = oShopList
cboShopList.DataSource = aBind
cboShopList.DisplayMember = "ShopName"
cboShopList.ValueMember = "ShopNumber"
cboShopList.DataBindings.Clear()
cboShopList.DataBindings.Add("SelectedValue", aBind, "ShopNumber")
This populates the combo correctly, and refreshes nicely when I change customer.
BUT when I test my combobox, I get erratic results. I test what value the combobox returns and it changes sometimes when I change the selection, sometimes not. Whichever item I pick in the list, the display part of the combo always displays the first item after briefly displaying the item I chose...even when it sometimes changes the ValueMembers value...
I am using VB.Net 2.0 and the app is your bog standard, run-of-the-mill windows application.
Like I say, I'm new so not sure if I am way off beam here, but any advice at this point would be helpful!
Cheers,
A seriously LostMonkey...
|
|
|
|
|
LostMonkey wrote: I have a seperate class called "Shops" which inherits from CollectionBase.
Why not just use a list of shops ? What does using your own class give you ?
What is a bindingsource ? Why do you need that in the middle ? Your datasource should work just pointing to your list.
I also don't see why you need the DataBindings. What do they do ? I'd just set the datasource to oShopList, and set the Display and Value members.
Do you know other languages and you're new to VB ? What other languages do you know ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have just started creating a new vb application which requires a login screen.
I have created a new database in sql server 2000 which holds the usernames and passwords.
I was wondering how i would create the connection and then link the username and password text boxes to the fields in the database.
Regards.
David
|
|
|
|
|
Do you have any code to show what you've attempted thus far?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Public Class
Private sqlConn AS SQLConnection = New Sql Connection (connectionstring)
Private sub LoginScript()
SqlConn.open
DIM SqlCmd AS New SQLCommand = (StoredProcdure, SqlConn)
Dim SqlAdapter as sqldataadapter = new sqlAdapter(sqlCmd)
Dim dt as new DataTable
SqlAdapter.fill(dt)
IF dt.select("username = " +txtUserName.text + "AND password = " + txtPassword.text) > 0 THEN
'login
Else
msgbox("Login Failed", "Login Failed", vbOK)
END IF
END sub
|
|
|
|