|
Brad Fackrell wrote:
what is the 92 for?
Thats the ASCII key code for \
For more info at those key codes, you can check ASCII Character Codes[^].
BTW, if you want to be really fancy, you can use the IO.Path.DirectorySeparatorChar instead...
Hope this could help you!
|
|
|
|
|
Absofukinlutely wrote:
Thats the ASCII key code for \
Ahhh...I see. Thank you very much.
|
|
|
|
|
I'd suggest that chr(92) is a complete hack. I certainly wouldn't use it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How would you tackle this one?
|
|
|
|
|
Anonymous wrote:
How would you tackle this one?
How would one tackle what
|
|
|
|
|
With the \ in quotes. \ is used to escape things, so you probably need to do Split('\\') instead of Split('\').
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Oh ok, is that also in VB? I thought that escaping with \ was only in C, C++ and C#.
I never had any problems with it...
|
|
|
|
|
I dunno, but I can't imagine why else someone would use chr(92) or whatever it was.
How do you put a control character in a string in VB then ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well, i think that is the only flaw in VB
Instead of "Blablabla\nSome more bla", you have to do "Blablabla" & vbNewLine & "Some more bla"
Also, \t = vbTab, \" = "" and \x92 = Chr(92)
A lot more typing...
Cheers!
|
|
|
|
|
Absofukinlutely wrote:
Well, i think that is the only flaw in VB
ROTFL - don't get me started.....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
That's where the wink is for, right?
See ya!
|
|
|
|
|
i cant remember if \ is a control character in VB but certaintly in VB6 i used to use the chr(92) format quite a lot. For one project i needed to build a VBScript string containing SQL and i found using the character ref was pretty much the only way when creating a string with ' " combinations. Dont think its as much of a problem in VB.Net but i havent really tried.
jon
|
|
|
|
|
Split is probably the easiest way to do this, as has been said, but a regular expression could also be used if you wanted to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Not sure exactly what you are after; here are several possibilities:
Where s = "C:\Targets\TestAirplane\TestAirplane_WebDoc\TestAirplane_HDS\01 Fuse"
s.Substring(0, s.IndexOf("Targets\") + 8)
Returns "C:\Targets\"
s.Substring(s.IndexOf("Targets\") + 8, s.Length - s.IndexOf("Targets\") - 8)
Returns "TestAirplane\TestAirplane_WebDoc\TestAirplane_HDS\01 Fuse"
s.Substring(s.IndexOf("Targets\") + 8, s.IndexOf("\"c, s.IndexOf("Targets\") + 8) - s.IndexOf("Targets\") - 8)
Returns "TestAirplane"
|
|
|
|
|
Is there a way to get the selectedvalue (or selectedtext or selecteditem) from a databound combobox into a string variable? I keep getting cast from datarowview to type string not valid.
|
|
|
|
|
Give one of these a try:
ComboBox.SelectedValue.ToString
OR
ComboBox.SelectedItem.ToString
|
|
|
|
|
I had already tried that.
still cast from datarowview to type string not valid
|
|
|
|
|
|
Also, have you tried:
ComboBox.Text
|
|
|
|
|
The error is in result of a query
'field_names is a string
'field_number is the underlying value
commandtext = "Select field_number,field_names From field_info where field_number = " & cbfieldEdit6.SelectedValue.ToString
cbfieldedit6.text works, but I need the underlying value
I think I will have to do it in a round about way...
commandtext = "Select field_number,field_names From field_info where field_names = " & cbfieldEdit6.text
and then use a datareader to get the value I need.
field1 = dr.getvalue(0)
oops... modified query
commandtext = "Select field_number,field_names From field_info where field_names = '" & cbfieldEdit6.text & "'"
|
|
|
|
|
|
I ended up querying the database for the underlying value using the combobox.text for the Where clause (Thankfully it doesn't cause much overhead)
I looked all over, and I am beginning to think that what I was trying to do is impossible by .net design. It is expected that you will be updating the datasource using the (updated) dataset.
.text is the only data that I could get out of a databound combobox.
|
|
|
|
|
Good Day,
I have decided that it is necessary to resize a form (new base size) as well as all of the controls it contains. But although I resize the form and its elements, when I run the program in debug mode (even after building & rebuilding both the project and solution) the changes do not take effect at run-time...only at design time.
Any help is greatly appreciated.
mtognetti
|
|
|
|
|
is it possible to make a program develpoed in vb.net and another one in c++ and make them communicate with each other using socket programming.if possible,how? Thanks
|
|
|
|
|
Of course you can! Over sockets, neither side gives a **** what language the other is written in.
One side needs to be written as a server and the other as a client. Kind of like an FTP server and FTP client.
But, something is telling me that your requirements won't be satified with this method. So, dare I ask... What are you REALLY trying to accomplish using this communication method?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|