|
Pablo.ar wrote:
but I didn't know there is no control array on .Net, why is that?
Because it's not proper OOP...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi,
I want to parser the data from the given query string.
mystring = "insert into testtable values(1,'ra,, j'a',100,'delhi')
in the above string, i need to take each fields seperately, How do i do this.
I want an array like
array(1) = 1
array(2) = 'ra,, j'a'
array(3) = 100
array(4) = 'delhi'
Thanks in advance
Be simple and Be sample.
|
|
|
|
|
For simple strings, without any escaping etc, you can use the string.Split function. For more complex strings (like I think you mean), the best approach is a simple character-by-character parsing of the data. I don't know of any (simple) generic parsers like this -- I suspect you'll have to write it from scratch.
my blog
|
|
|
|
|
Steven Campbell wrote:
the best approach is a simple character-by-character parsing of the data
Maybe the best approach if you'be never spotted the RegEx[^]class
|
|
|
|
|
Yes of course, you're correct -- it's probably the simplest solution for this problem, and should work 99% of the time.
99% because regex is really good at handling patterns, but really bad at handling edge cases. For example, you can easily write a regex expression to detect some characters, followed by some other characters enclosed in ( ). However, what if someone uses a ( legitimately as part of the first set of characters. This is just one of many possible edge-cases.
You then have to modify your regex to handle that. Over time, the regex becomes huge and unreadable, and probably still not 100%.
my blog
|
|
|
|
|
Hi,
I've implemented global mouse and keyboard hooks in C#, however, once I set the hook type to WH_CBT and run the application, an ugly black command prompt screen prompts out saying there was an error in CLR at runtime
Has anybody been able to implement system-wide CBT hooks in any .NET language?
If I keep getting stuck in this, can I make a c++ DLL that does all the hooking and use it in my C#/VB.NET app?
Thanks
|
|
|
|
|
I need to do a network command to purge (OS:netware)
I'm using a DOS command to delete some folder
Shell(Environ("comspec") & " /C RD /S /Q " & SubDir)
but i need to use a purge command too on a network (purge /a), to assure that those deleted won't be retrieved by any means
how can i do this?
|
|
|
|
|
Same way you ran the other command, Shell("PURGE /A"). Of course, you'll actually have to specify the correct command line for your purge.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ummm I'm not sure what is the command line for this
do i have to specify an environment like the "comspec"
would this be correct? Shell(Environ("comspec") & " /C PURGE /A ")
|
|
|
|
|
No, the commandline doesn't need to have COMMAND in it, just "PURGE /A", or whatever you'd type at the command prompt.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hai, everybody!!! I got problem with silent install by using platform VB.NET and actually, i dont know how to start it! So, everyone who know the sample code or any web site for this silent installation that can let me for reference it!
:-OThanks for ur!;P
|
|
|
|
|
|
Thanks for u, Ranoush!!!
|
|
|
|
|
I have created a windows Service and from this service i am trying to print a File but it is not doing this. I am doing as follows
Dim pr_Process As New Process
pr_Process.StartInfo.FileName = "C:\Hello.txt"
pr_Process.StartInfo.Verb = "print"
pr_Process.StartInfo.UseShellExecute = True
pr_Process.StartInfo.CreateNoWindow = True
pr_Process.Start()
It is not generating any error but also not printing any thing.
waiting for Fellow reply
Thanks
|
|
|
|
|
Did you tag your service (in the Service Control Manager) as "Allow service to interact with desktop"? Since your using ShellExecute = True and using Notepad (I assume) to do the printing, you need to allow your service to interact with the desktop so your app has access to the Desktop Shell and the is actually a Desktop to run Notepad on, regardless of your CreateNoWindow property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a timing problem with class objects becoming available to external processes from an ActiveX Server (EXE Server) before the Main() function has completed initialization. The EXE Server is set to be single threaded (i.e. thread pool = 1) and the class objects are all multiuse.
The class objects require resources initialized by Main() and thus when the external process creates one of these objects, the object's initialization fails because the required resources are not available.
This is apparently a well known problem with ActiveX Servers but I am not in a position to rearchitect or rewrite the code - I am stuck with VB 6.
My question is this: how can I control the availability of the class objects until AFTER the EXE Server Main() function has completed?
I have read articles which state that you can overcome the problem with calls to CoRegisterClassObject() with the REGCLS_SUSPENDED option and then calling CoResumeClassObjects() when initialization is complete, but no samples on how to do this from VB 6.
TIA.
...Steve
|
|
|
|
|
Hi does someone know how to send a mouse click signal
I want to send a code that the mouse sends the left click and holds it
do you know how to make it?
|
|
|
|
|
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const BM_CLICK = &HF5
Dim x As Long, staticx As Long, MyStr As String, y As String, control As Long
x = FindWindow("#32770", vbNullString)
'x = FindWindow(vbNullString, "Project")
' get handle to Ok button
control = FindWindowEx(x, 0, "Button", "Ok")
' click the button
SendMessage control, BM_CLICK, 0, 0
SendMessage control, BM_CLICK, 0, 0
End Sub
That's how you click a button on a msgbox - in this case "ok". I imagine it will be reasonably similar but not sure about the holding it, you could try putting the SendMessage Control in a loop.. The #32770 is the msgbox class, to send a message to a different window use the commented out bit and put the name of the window you wish to send the message to in place of "Project"
Sound!!!!!!
Hope you can work with that
"If i was king cigarettes would be free."
|
|
|
|
|
this is whaT I have....
<br />
Dim i As Integer<br />
Do While Not rs.EOF<br />
<br />
For i = 0 To rs.Fields.Count - 1<br />
DepartmentCbo.Text = DepartmentCbo.Text & rs.Fields("Department").Value<br />
LocationCbo.Text = LocationCbo.Text & rs.Fields("Location").Value<br />
<br />
Next<br />
rs.MoveNext()<br />
Loop<br />
What am i missing???
the result is the contents are filled next to one another not listed like this museumplanetariumfloor1floor2 it should b like this
museum
planetarium
floor 1
floor2
etc.
Help is great only if you ask correctly
|
|
|
|
|
hey, jlawren7:
Did you re-type this to post it? Cause I'm seeing a very small bug... at the 'Next' line... shouldn't it say Next i?
Regards.
Pablo.
|
|
|
|
|
i copied and pasted the code i trid putting " i " after next but i still get the same results
in vb6 i could do this
ADODeptLocation.Refresh
ADODeptLocation.Recordset.MoveFirst
CboDepartment.AddItem ADODeptLocation.Recordset("Department")
CboLocation.AddItem ADODeptLocation.Recordset("Location")
'loop through for all the records
Do While Not ADODeptLocation.Recordset.EOF
CboDepartment.AddItem ADODeptLocation.Recordset("Department")
CboLocation.AddItem ADODeptLocation.Recordset("Location")
ADODeptLocation.Recordset.MoveNext
Loop
CboDepartment.ListIndex = 0
CboLocation.ListIndex = 0
and this would fill the combo box list items
Help is great only if you ask correctly
|
|
|
|
|
If you are usinig VB .NET you could easily just set the combobox datasource to the dataset you are going to use for it and then set the displaymember property to the field in the dataset in the properties box of the combobox.
|
|
|
|
|
Hi,
I have several textboxes connected to an MS access database (not with code but wizards). I also have a tab control.
The problem is: when I clear the textboxes with textbox1.text = "" or .clear method it clears it (or so it seems), but when I click on a different tab and back it reappears like it haven't been cleared
I also tried clearing dataset, not working.
I have tried almost everything, and nothing seems to fix this problem.
Any suggestions?
Thank You
|
|
|
|
|
So your textboxes are bound to a table.
Are yo trying to add a new record ? is this why your clearing the textboxes?
BTW if you clear text boxes ty not to use the ""
use this ex. textbox1.text =vbnullstring
vbnullstring is a faster and mre efficient way of clearing a TEXTbox or checking the contents of a text box
post some code so we know what your trying to do...
Help is great only if yu ask correctly
|
|
|
|