|
Hi All,
I have created a customer database that contains customer details.
I have pasted a datagridview called CustomerDetailDatagridView that contains a list of the client details from the database.
In VB.net express 2008, is there a way I can filter the results of the datagrid simply by typing a name in a textbox just below the datagrid?
For e.g. I would like to type 'Jo' and all the entries with the term '*Jo*' will be returned (e.g. John, Johnathan etc).
Any help will be greatly appreciated...
A
|
|
|
|
|
Hello,
You can use the TextChanged() event of Textbox to filter the DataGridView.
Lets say, you have the following settings in Form_Load event of the application:
Me.OleDbDataAdapter1.Fill(DataSet11)
Me.BindingSource1.DataSource = DataSet11.Tables("Customers")
Me.DataGridView1.DataSource = Me.BindingSource1
Now in the TextChange() event, you can use the following code:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = "" Then
Me.BindingSource1.Filter = ""
Else
Me.BindingSource1.Filter = "ContactName like '" & TextBox1.Text & "*'"
End If
End Sub
Now as you start typing in the textbox, it will start filtering the grid rows automatically.
I hope this will help.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Hi All,
I am fairly new to programming in vb.net express.
I have downloaded a copy of vb.net express 2008 and was wondering how to open a crystal report from an application I have developed.
I have purchased a copy of crystal reports version 11 and created a new report that I have already linked into my database. (this report works fine when I double click and open it)
All I would like the application to do is when I click a button, I would like it to open my crystal report that I have saved on C:\temp.
Can I have step by step instructions please?
Abs
modified on Wednesday, April 2, 2008 2:39 AM
|
|
|
|
|
I have a web application in VS2008 VB.
I want to have a database check done at intervals. It seems to me that I should be setting it up using myapplication.startup - initiate a timer which does something useful every 30 minutes.
Trouble is, I can't figure out where my code goes. The MSDN article on how to add startup code directs me to menu options I cannot find. I get the general idea that I should have a file called "ApplicationEvents.vb" which has a startup event for class "myapplication" but it doesn't run the code.
I seem to remember using a config.web approach years ago, but I can't find a reference for that, either.
Thanks in advance.
Everyone else's job looks easy
|
|
|
|
|
You don't need the Startup event at all. Simplify this.
How you do this depends on what you're "checks" are doing and what you want to do when the checks fail. If you're doing this every 30 minutes, you can write this as a console app or a Windows forms app and use the Windows Task Scheduler to run this app every half hour. When it's job is done, the app should quit on its own.
Or, you could skip the Task Scheduler and write it as an app that stays running for as long as you want, performing it's checks on whatever schedule you chose. You'd use a timer to check the current time against the scheduled time. You'd probably set this timer to 60000 milliseconds, which will fire the Tick event every 60 seconds. In this event is where you'd check the current system time against the scheduled time. If the two match, then you'd reschedule the next scheduled time and launch your checks routine.
|
|
|
|
|
hi
i hope any one can help me
i want to ask how can i do undo && redo
in a database application that add delete and update
i want starting point pleas help
|
|
|
|
|
Google for "Command pattern".If you're looking to implement undo/redo operations in database transactions, you'd probably want to look into designing your database to log everything it does, including which fields it updates and what type of update what done to that record.
|
|
|
|
|
I have obtained and installed a copy of EZNamespaceExtensions, as I thought it would help me creating my application (an archiver, that shows the contents of the archive in a Namespace Extension).
I have created a new EZNamespaceExtensions project, and added my class to read archives, but could someone please point me in the right direction for making the actual Extension?
Thank you in advance, and Best Regards,
Fahad Sadah
|
|
|
|
|
|
That's great, but I've decided to just write it in C++. I just saw somewhere not to write namespace extentions in managed code.
|
|
|
|
|
I want to integrate 3 application into one parent window. Is this possible. Thanks.
|
|
|
|
|
IIRC, a long time ago I did this by basically getting the window's handle then calling SetParent() to change its parent to be my app. I figure there was more to it but maybe that will get you started.
|
|
|
|
|
I did a significant amount of programming in QBasic, though that was when I was much younger. I'm trying to move on up, and have 'began' developing many games in visual basic... though most never got beyond the setup phase.
I've been working for some time on a pool game, but am having several problems. I'm not looking for anyone to parse through my code, but included it all in case it is needed. I specifically need help with my trig functions.
The last function in my code (where I need help) is for a timer, with which I reference its interval for my acceleration and velocity formulas. They seem to be working ok. As I understand it, my ATN() function should be returning an angle based on change in y value divided by change in x value updated each interval of time.
I have 6 separate displays for each ball on my screen to show:
x position
y position
distance between it and all other balls (while dragging)
velocity as I drag it around
acceleration as I drag it around
and angle as I drag it around
The problem is that the display for angle only ever shows a -1, 0, 1 (and the very rare 2 for some reason). After I let go of the ball, it flies off (as desired) in the direction it was launched, however the angle seems to be constrained to (guessing) 0, 30, 45, 60 and 90 for each quadrant. I'm afraid that this is based on my using the Sin or Cosine of the velocity and angle it was traveling when I let go of the ball, but I'm really at a loss as to why... it all looks correct to me.
(I also can't get any balls that are hit by my ball dragging across them to move, but that is really a problem I can likely figure out once I get this first issue resolved).
Also, any tips on how to modularize my code better would be appreciated, but I would need pretty specific tips... I've tried creating my own functions before, but they become as bloated as the rest of my code as I am forced to add new things to it periodically.
my e-mail address is cmikaiti@yahoo.com if anyone wishes to contact me personally, where I would be happy to send you the actual files if it helps.
Thanks for any and all helps, tips, and constructive criticism.
-Chris Mikaitis
My current code (messy and uncommented, unfortunately) is as follows:
Option Explicit
Dim x1, y1 As Integer
Dim i, j As Integer
Dim Drag As Boolean
Dim BallNum, GrabbedBall As Integer
Dim VGrabbedBall(1 To 10), AGrabbedBall(1 To 10), AngleGrabbedBall(1 To 10) As Long
Dim VHitBall(1 To 10), AHitBall(1 To 10), AngleHitBall(1 To 10) As Long
Dim BallDirx(1 To 10), balldiry(1 To 10) As Integer
Dim OldX, OldY, OldVelocity As Long
Private Sub Command1_Click()
For _
i = 1 To BallNum
Unload Ball(i)
Unload BallXVal(i)
Unload BallYVal(i)
Unload Proximity(i)
Unload Velocity(i)
Unload Acceleration(i)
Unload Angle(i)
Next i
Unload Form1
End Sub
Private Sub Form_Load()
Randomize
x1 = 0
y1 = 0
i = 0
j = 0
OldX = 0
OldY = 0
OldVelocity = 0
BallNum = 5
GrabbedBall = 1
Drag = False
For _
i = 1 To 10
VGrabbedBall(i) = 0
AGrabbedBall(i) = 0
Next i
For _
i = 1 To BallNum
Load Ball(i)
Do
Ball(i).Left = Int(Rnd(1) * 15000)
Ball(i).Top = Int(Rnd(1) * 11000)
Ball(i).Visible = True
Loop Until _
Ball(i).Left > Table.Left And _
Ball(i).Left + Ball(i).Width < Table.Left + Table.Width And _
Ball(i).Top > Table.Top And _
Ball(i).Top + Ball(i).Height < Table.Top + Table.Height
Load BallXVal(i)
BallXVal(i).Text = Ball(i).Left + 0.5 * Ball(i).Width
BallXVal(i).Visible = True
BallXVal(i).Top = BallXVal(i - 1).Top + BallXVal(i - 1).Height
Load BallYVal(i)
BallYVal(i).Text = Ball(i).Top + 0.5 * Ball(i).Height
BallYVal(i).Visible = True
BallYVal(i).Top = BallYVal(i - 1).Top + BallYVal(i - 1).Height
Load Proximity(i)
Proximity(i).Visible = True
Proximity(i).Top = Proximity(i - 1).Top + Proximity(i - 1).Height
Proximity(i).Text = 0
Load Velocity(i)
Velocity(i).Visible = True
Velocity(i).Top = Velocity(i - 1).Top + Velocity(i - 1).Height
Velocity(i).Text = 0
Load Acceleration(i)
Acceleration(i).Visible = True
Acceleration(i).Top = Acceleration(i - 1).Top + Acceleration(i - 1).Height
Acceleration(i).Text = 0
Load Angle(i)
Angle(i).Visible = True
Angle(i).Top = Angle(i - 1).Top + Angle(i - 1).Height
Angle(i).Text = 0
Next i
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 1 To BallNum
If _
X > Ball(i).Left And _
X < Ball(i).Left + Ball(i).Width And _
Y > Ball(i).Top And _
Y < Ball(i).Top + Ball(i).Height Then
If _
Button = 1 Then
x1 = X - Ball(i).Left
y1 = Y - Ball(i).Top
Drag = True
GrabbedBall = i
Ball(i).BorderColor = &HFF&
End If
End If
Next i
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If _
Drag = True Then
For _
i = 1 To BallNum
Proximity(i).Text = Sqr(((Ball(GrabbedBall).Left - Ball(i).Left) ^ 2) + (Ball(GrabbedBall).Top - Ball(i).Top) ^ 2)
If _
0.5 * Ball(GrabbedBall).Width + 0.5 * Ball(i).Width > _
Sqr(((Ball(GrabbedBall).Left - Ball(i).Left) ^ 2) + (Ball(GrabbedBall).Top - Ball(i).Top) ^ 2) Then
Ball(GrabbedBall).Top = Y - y1
Ball(GrabbedBall).Left = X - x1
BallXVal(GrabbedBall).Text = Ball(GrabbedBall).Left + 0.5 * Ball(GrabbedBall).Width
BallYVal(GrabbedBall).Text = Ball(GrabbedBall).Top + 0.5 * Ball(GrabbedBall).Height
Command1.Caption = "hit"
VHitBall(i) = VGrabbedBall(GrabbedBall)
AHitBall(i) = AGrabbedBall(GrabbedBall)
AngleHitBall(i) = AngleGrabbedBall(GrabbedBall)
End If
Next i
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Drag = False
Ball(GrabbedBall).BorderColor = &H0&
X = 0
Y = 0
x1 = 0
y1 = 0
End Sub
Private Sub Timer1_Timer()
If Drag = True Then
If Ball(GrabbedBall).Left <> OldX Then
AngleGrabbedBall(GrabbedBall) = Atn((Ball(GrabbedBall).Top - OldY) / (Ball(GrabbedBall).Left - OldX))
End If
Angle(GrabbedBall).Text = AngleGrabbedBall(GrabbedBall)
VGrabbedBall(GrabbedBall) = Sqr((Ball(GrabbedBall).Left - OldX) ^ 2 + (Ball(GrabbedBall).Top - OldY) ^ 2 / Timer1.Interval)
Velocity(GrabbedBall).Text = VGrabbedBall(GrabbedBall)
If OldX > Ball(GrabbedBall).Left Then
BallDirx(GrabbedBall) = -1
Else: BallDirx(GrabbedBall) = 1
End If
OldX = Ball(GrabbedBall).Left
OldY = Ball(GrabbedBall).Top
AGrabbedBall(GrabbedBall) = (VGrabbedBall(GrabbedBall) - OldVelocity) / Timer1.Interval
Acceleration(GrabbedBall).Text = AGrabbedBall(GrabbedBall)
OldVelocity = VGrabbedBall(GrabbedBall)
End If
For i = 1 To BallNum
Ball(i).Left = Ball(i).Left + BallDirx(i) * Cos(AngleGrabbedBall(i)) * VGrabbedBall(i)
Ball(i).Top = Ball(i).Top + BallDirx(i) * Sin(AngleGrabbedBall(i)) * VGrabbedBall(i)
If VGrabbedBall(i) < 10 Then
VGrabbedBall(i) = 0
Else
VGrabbedBall(i) = 0.9 * VGrabbedBall(i)
End If
If Ball(i) <> Ball(GrabbedBall) Then
Ball(i).Left = Ball(i).Left + BallDirx(i) * Cos(AngleHitBall(i)) * VHitBall(i)
Ball(i).Top = Ball(i).Top + BallDirx(i) * Sin(AngleHitBall(i)) * VHitBall(i)
VHitBall(i) = 0.9 * VHitBall(i)
End If
Next i
End Sub
|
|
|
|
|
Hi,
I haven't studied your code in any detail, but I wonder how you want to get by
without using real numbers; after all trig functions such as sin() and atn()
work with reals, often limited to the range [-1,+1] so how would you want integers
to cope with that?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
That was precisely my problem... I can't believe it was so simple.
Thanks,
-Chris Mikaitis
|
|
|
|
|
I'm really new to VB.net development and I've gotten my application to work pretty well on my development machine. Here is where is gets weird: I use the Publish menu option to create a ClickOnce installation on a USB key. I plug the key into my first non-development computer and run the setup.exe; everything works smoothly. I can run my application from the start menu. What I need to find is the location of where all the installed files are located. I have to make a change to the .config file where my db connection string is defined and I have to make sure that all of my Crystal Reports are stored in the right directories.
When I use the find files feature in Windows Explorer, I can't find my application installed on the computer anywhere !! I can find the reference to the shortcut that launches the report but I can't tell where the shortcut is pointing.
Where is my application ?
Thanks.
|
|
|
|
|
Hey David, I believe the files go in the "application cache." The parent directory may be marked as hidden and that's why you aren't finding them. I don't have an example of a location because I quit using ClickOnce sometime back but at the bottom of this page[^] there is a screenshot of a MsgBox() that shows the installed location. I'd figure your app is in a nearby folder.
|
|
|
|
|
Am new to VB, and i really want to get my hands on programming in VB is ant one intrested in helping me out in term of e-books cos my project is base on VB
|
|
|
|
|
Hi,
welcome to this site.
I hope you mean VB.NET, and not VB; VB is an ancient language by todays standards.
There are plenty of people here that are willing to help you with VB.NET for sure.
I'm more of a C# guy.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hello
I am using vb.net 2003 so is it possbile to create masked text box like vb.net 2005
and if yes then any clue
any help
waiting for your rep.
have a nice time
|
|
|
|
|
Hi,
of course you can create your own control that behaves like a MaskedTextBox in .NET 2;
hust derive your class from TextBox and add the appropriate methods and properties.
You can use the .NET 2.0 documentation to get your inspiration.
You could even download the ssCLI (shared source, Google it) and see how Microsoft did it.
But you should be able to do it yourself from scratch too.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
hi all,
i want to create a report in crystal reports in the following format.
Liabilities Assets
----------- ------
Capital Account 15100.00 Fixed Assts 5000.00
Sundry Creditors 2000.00 Sundry debtors 3000.00
i have created a report but it gives me results in different style. like
Liabilities Assets
=========== =======
0.00 Fixed Assets 5000.00
0.00 Sundry debtors 5000.00
Capital Account 15100.00 0.00
Sundry Creditors 2000.00 0.00
but i want it in above style.
any help would be appreciated.
thanks.
rmshah
Developer
|
|
|
|
|
You could probably create your report with two sub-reports - one for the Liabilities and the other for the Assets.
HTH.
|
|
|
|
|
hi ChandraRam,
Thanks a lot for your kind support. i have done, but i am not handle the account which have balance= 0
i have written a formula Like:
if fieldDr>0 then
variable=fieldDr;
but still it shows account with zero balance in cr report.
Thanks again,
rmshah
Developer
|
|
|
|
|
I remember that there were some properties like SuppressWhenZero and SuppressBlankLines (don't know which version had these) - maybe you could try those?
|
|
|
|