|
I have a DataSet which has Two tables: TableAll, TableQueried
TabelAll has all data available.
What I want is to use a command to select only those rows in TableAll and copy them to TabelQueried which are LIKE some pattern.
I knew how to do this when I had a database and used connections; but now there is no database.
How should I do anything like this command:
"SElECT * FROM TABELALL WHERE Data LIKE " & Pattern
|
|
|
|
|
You could just use a 'For each row' in TableAll, and then check the existing condition that you're looking for (the like) and then when the row meets the condition insert 'row' into TableQueried.
Nate Lindley
|
|
|
|
|
Thank you for your answer, but in fact this is what I am doing right now!
But as a matter of fact, my Table is very huge and I have to do the search many times. If I make a search on all rows for every search, it would be slow.
I am looking for faster methods, if any...
|
|
|
|
|
Why do you want to dump the results into a new table? Why not just fill the original table with a dataset query based on your search option?
|
|
|
|
|
If you're using VS 2005, you could also use the ToTable method of the System.Data.DataView class.
|
|
|
|
|
Thank you, I will give it a try...
|
|
|
|
|
Oh This didn't cover what I needed!
Thanks anyway!
|
|
|
|
|
I am trying to cancel the mouse wheel scrolling in a combobox and I noticed that there is a Combobox.MouseWheel event but that just relays information it doesnt allow me to cancel the event.
This is the only thing I have found with some type of definite answer[^] and it looks like something that I dont want to do unless I have to.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
That's the only way you're going to be able to do it. You have to intercept the Scroll Wheel messages before they get processed by the controls WndProc.
|
|
|
|
|
Here's what Im trying and it doesnt pick up the scrolling while focused on the combobox only if I scroll with the mousewheel while focused anywhere else does it work.
Private Const WM_MOUSEWHEEL As Integer = &H20A<br />
<br />
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)<br />
Select Case m.Msg<br />
Case WM_MOUSEWHEEL<br />
Select Case True<br />
Exit Sub<br />
End Select<br />
MyBase.WndProc(m)<br />
End Sub
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Where is this code?? Is it on your Form or is it part of a custom ComboBox control?? This code has to be part of a custom ComboBox to work.
You got it mostly right. Though, your Select Case is really messed up. You don't need the Select Case True . That will ALWAYS execute it's code no matter what. All you want is to NOT process MouseWheel messages. All other MUST be passed to the base ComboBox control. Soooo....
Public Class MyComboBox
Inherits ComboBox
Private Const WM_MOUSEWHEEL As Integer = &H20A
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_MOUSEWHEEL
' If we see a MouseWheel message, do not process it!
Exit Sub
End Select
' All other messages get processed as normal.
MyBase.WndProc(m)
End Sub
End Class
... is what you're looking for.
|
|
|
|
|
I sure was hoping it was easier but no biggie. Ive dont a few custom controls in my day... .
That select true used to contain code by the way but I was still in the middle of messing with it.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
I start a new job and my boss ask me if I can write the program to print the bar code label. Any one can help me out. Thanks.
Linh do
dolinh25@yahoo.com
|
|
|
|
|
There are numerous fonts that contain the 3 of 9 bars. WASP also has a barcode font and assembly in .NET.
I would recommend searching Google for a solution that meets your needs.
|
|
|
|
|
I have a variable on another form that I need to read and write to. I know it'll be obvious once someone tells me...
Just for the record, the form with the variable I'm trying to access is frmMainTools and the one I'm trying to access from is frmMain.
A timely answer would be most helpful. Thanks!
---------------------------------------
If it ain't broke, you're not tryin'!
|
|
|
|
|
The easiest method is to declare the variable on frmMainTools as public.
|
|
|
|
|
Dim mCurrentForm As Form
How would one make that public when it is already declared as a Form?
|
|
|
|
|
Looks like I got it figured. Thanks for the help and speedy responses.
The fact that this is going to be an app for just this company and it's a rather small app causes me to not worry about messy code. It doesn't need to work fast and besides that, it's only a database front-end, so I'm not going to be too worried if it breaks.
Thanks again!
--------------------------------
If it ain't broke, break it!
|
|
|
|
|
Maybe the easiest, but not the best in terms of OOP. Globals are not good
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
The best way to do this is to set up a delegate between the forms that fires the value across when it is changed. This is far cleaner than making variables public.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hi,
While I was running a vb.net application in a local drive, the application was runnig fine. But as soon as I tried to work with the same application on a network drive, I was facing the following error.
Request of the permission of tyepe 'System.Data.oledeb.oledbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Please anybody help me to solve this problem.
with regards
vishal
|
|
|
|
|
Code running from any non-local source is, by default, not trusted. Therefor, it runs in a restricted sandbox that has permissions to just about nothing. If you're going to be running code from non-local sources, i.e.: ANY network source, share, whatever, ..., you're going to have to understand Code Access Security[^].
|
|
|
|
|
hi all
i m working on a word pad like application and i place a ruler on and need to place the slider of the ruler.
does someone has any kind of idea about the work
if yes then plz tell me
|
|
|
|
|
history:
I need to put shortcut key's on a button (is actually a label that I draw myself and that acts as a button)
My first idea was to put '&' before the desired letter (didn't work)
My second idea was to catch the keydown event of the form and check for myself witch button was pressed and act appropratly (after a bit fiddling got it to work pretty nice)
then I noticed as soon as I opened another form (in the mdiparent where I catch the keydown event) the keydown didn't get triggerd (now I know that is normal beceause the new form has the focus) so I put the property 'Keypreview' on true and quess what everything worked again.
Information:
in the project we are working on, we are using datawindows to display the data from the db in a grid or editable form (for those that don't know what datawindows is: its a 'component' that you create outside of visual studio and then can use in visual studio without much programming (has an access feel to it (I'v only been using it for a week now so not that good at it yet))).
Problem:
When I put the fields on the datawindow on editable and the cursur is in such a field the shortcuts don't work anymore but when the fields aren't editable they do work ofcourse this isn't really what we want (shortcuts that work only a small part of the time)
Additional information:
I have shortcutkeys that remain the same over the entire project (mdiparent level) and shortcutkeys that are form specific.
Anyone have any idea why I have this problem?
|
|
|
|
|
Hi all,
I have a windows form that contains a listview and a contextmenu. The form is splitted with a splitter control. In load event the data will be populated in the list view. When we activate menu the menuitems will be dispalyed like Add, Edit, Delete..
My problem is , if the user clicks a region which data is not present, ie. suppose the list view contains 3 rows, remaing white space will be there, when the user clicks that white space , the menu should not be displayed.
Now context menu will be displayed whenever user right clicks the mouse.
I want to display context menu only if the user clicks a row in the list view. Please help me to do this...
Thanks in advance
Sebastian
|
|
|
|