|
Let's see the code you used to try to create this instance. You've probably missed something very basic in the process.
|
|
|
|
|
I have several no. of records in the database for payroll processing. The Employee Code No. is the primary key and a employeemaster table is connected through coding. When am in the processing screen, if i enter or select the employee code no. the other columns must be automatically filled or a search form that displays info. abt the emp name, desig etc. How to design a search form for this and write coding. Pls help Me?
|
|
|
|
|
- Put the label and textbox that the user can enter EmployeeNo
- Add the Grid for displaying the result.
- Add one button that the user can click for searching..
- In button click event, write the code to query the data from database with filter. And bind it to Grid.
That's all.
|
|
|
|
|
hi S.SRIVATHSAN
i have an Article that has exactly what you want,our friend who jst gave you an advice now, is right, and the article you find Example vb codes
http://www.codeproject.com/KB/vb/N-Tier_Application_VB.aspx[^]
Hope this Helps
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
<br />
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _<br />
<br />
Partial Class Form1<br />
<br />
Inherits System.Windows.Forms.Form<br />
<br />
'Form overrides dispose to clean up the component list.<br />
<br />
<System.Diagnostics.DebuggerNonUserCode()> _<br />
<br />
Protected Overrides Sub Dispose(ByVal disposing As Boolean)<br />
<br />
Try<br />
<br />
If disposing AndAlso components IsNot Nothing Then<br />
<br />
components.Dispose()<br />
<br />
End If<br />
<br />
Finally<br />
<br />
MyBase.Dispose(disposing)<br />
<br />
End Try<br />
<br />
End Sub<br />
<br />
<br />
<br />
Friend WithEvents CustomerID As System.Windows.Forms.DataGridViewTextBoxColumn<br />
<br />
'Required by the Windows Form Designer<br />
<br />
Private components As System.ComponentModel.IContainer<br />
<br />
'NOTE: The following procedure is required by the Windows Form Designer<br />
<br />
'It can be modified using the Windows Form Designer. <br />
<br />
'Do not modify it using the code editor.<br />
<br />
<System.Diagnostics.DebuggerStepThrough()> _<br />
<br />
Private Sub InitializeComponent()<br />
<br />
Me.Label1 = New System.Windows.Forms.Label<br />
<br />
Me.DataGridView1 = New System.Windows.Forms.DataGridView<br />
<br />
Me.CustomerID = New System.Windows.Forms.DataGridViewTextBoxColumn<br />
<br />
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()<br />
<br />
Me.SuspendLayout()<br />
<br />
'<br />
<br />
'Label1<br />
<br />
'<br />
<br />
Me.Label1.AutoSize = True<br />
<br />
Me.Label1.Location = New System.Drawing.Point(13, 181)<br />
<br />
Me.Label1.Name = "Label1"<br />
<br />
Me.Label1.Size = New System.Drawing.Size(39, 13)<br />
<br />
Me.Label1.TabIndex = 0<br />
<br />
Me.Label1.Text = "Label1"<br />
<br />
'<br />
<br />
'DataGridView1<br />
<br />
'<br />
<br />
Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize<br />
<br />
Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn(){Me.CustomerID})<br />
<br />
Me.DataGridView1.Location = New System.Drawing.Point(16, 12)<br />
<br />
<big>Me.DataGridView1.MultiSelect = False</big><br />
<br />
Me.DataGridView1.Name = "DataGridView1"<br />
<br />
<big>Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect</big><br />
<br />
Me.DataGridView1.Size = New System.Drawing.Size(240, 150)<br />
<br />
Me.DataGridView1.TabIndex = 1<br />
<br />
'<br />
<br />
'CustomerID<br />
<br />
'<br />
<br />
Me.CustomerID.HeaderText = "CustomerID"<br />
<br />
Me.CustomerID.Name = "CustomerID"<br />
<br />
'<br />
<br />
'Form1<br />
<br />
'<br />
<br />
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)<br />
<br />
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font<br />
<br />
Me.ClientSize = New System.Drawing.Size(284, 264)<br />
<br />
Me.Controls.Add(Me.DataGridView1)<br />
<br />
Me.Controls.Add(Me.Label1)<br />
<br />
Me.Name = "Form1"<br />
<br />
Me.Text = "Form1"<br />
<br />
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()<br />
<br />
Me.ResumeLayout(False)<br />
<br />
Me.PerformLayout()<br />
<br />
End Sub<br />
<br />
Friend WithEvents Label1 As System.Windows.Forms.Label<br />
<br />
Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
'this is the method I'm talking about:<br />
<br />
<big>Private Sub DataGridView1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChanged<br />
<br />
Label1.Text = sender.SelectedRows(0).Cells("CustomerID").Value.ToString<br />
<br />
'last line causes either an ArgumentOutOfRangeException saying 'Index is out of range'<br />
<br />
'or an ArgumentException (see details below)<br />
<br />
End Sub</big><br />
End Class<br />
<br />
<br />
<br />
<br />
Shimi
|
|
|
|
|
Hi Shimi
I am using the following code which works for me
DataGrid_search.CurrentRow.Cells.Item(0).Value.ToString()
Good Luck
|
|
|
|
|
Hi,
I am currently writing an application which in simple terms is used for logging in and out hardware repairs. On one of the forms in this project, I have a data grid view control, two command buttons and a text box. The problem that I am having is that I do not understand how to code a data grid view - I have tried source code from many sites but cannot get my head around it. I have provided a description below of what it is I want the grid view to be populated with. After getting that working, It'd also be great to know how I can filter it using the AutoID number or Serial Number by using the text box and a seperate button each for the serial no or AutoID.
Fields in the table in question: AutoID, DateReceived, Customer, Location, SerialNo, ProductNo, ReferenceNo, ReportedFaults, DateToSym, SymRepeatNotes, SymFaultsFound, SymRepairDescription, SymDateReturned, SymLeopardServices, SymRepeatRepair, DateRepaired, Technician, RepeatRepair, FaultsFound, Notes, ActualRepair, PartsUsed, DateOut, RepairDescription, TotalCharges, BillType, ShipmentDate.
Fields I want shown in the datagrid: AutoID, DateReceived, Customer, SerialNo, ProductNo, ReportedFaults, ActualRepair.
It needs to be filtered by Serial Numnber or Auto ID Number using the method mentioned above.
If anyone could provide me with some sample code, a link to another message on this site, or even build me some code based on what I need with some notes in it, it'd be greatly appreciated.
Thankyou in advance.
Brett.
|
|
|
|
|
brettfk1010 wrote: DataGridView Control in VB6
There's noi such thing as a DataGridView control in VB6. DataGridView didn't show up until .NET 2.0 (VB.NET 2005).
So which is it?? VB6 or VB.NET 2005??
|
|
|
|
|
My apologies
I am trying to use the Data Bound Grid Control or DataGrid Control to do it, whichever is easier.
|
|
|
|
|
I have a DataSet i want to make one cloumn as pivot ...Is there any solutin
|
|
|
|
|
AFAIK, the default one doesn't have that feature.. You probably need to find the third-party one. I wonder why you want to make one column as pivot..
|
|
|
|
|
Colleagues,
Could you recommend a 2D chart control for my application that can work with VB6? I need to plot an EEG signal on the screen in real time. The update rate of the chart will be on the order of 200ms to 1000ms, and I want to display 1000 points. Ideally, the whole chart would scroll to the left as new values are added on the right.
I’ve tried the MSChart, it would work ok, but I don’t know how to get rid of flickering. Flickering is a real problem, because somebody will be looking at the chart for hours.
Thanks and have a happy new year!
- Nick
|
|
|
|
|
Have you tried to use DoEvents ?
|
|
|
|
|
No, I haven't tried to use DoEvents . How would that stop the flickering?
I suspect that MSChart flickers, because it doesn't do the double buffering.
|
|
|
|
|
Nick Alexeev wrote: I suspect that MSChart flickers, because it doesn't do the double buffering.
I also think so.. but at least, you can try DoEvent. if it helps, you don't need to change. if not, you need to find the third-party one as other suggested..
|
|
|
|
|
The MSChart control isn't a good candidate for this problem. You'd be better off using a third party component to draw a scrolling line graph, or making your own control so you can have more control over exactly how it's drawn.
DoEvents won't do anything for you here. In fact, there's nothing you can do about the flickering using the MSChart control.
|
|
|
|
|
Dave Kreskowiak wrote: The MSChart control isn't a good candidate for this problem. ... In fact, there's nothing you can do about the flickering using the MSChart control.
Yes, I can agree that MSChart is not a good tool for this job. I've searched the web for suggestion on how to make good real-time plots with MSChart and tried every suggestion I could find, but the results weren't good enough.
Dave Kreskowiak wrote: You'd be better off using a third party component to draw a scrolling line graph, or making your own control ...
Unfortunately, I don't have the time to make my own control, although that could be a fun endeavor. Which 3rd party chart controls would you recommend?
|
|
|
|
|
Don't know. I haven't used any StripGraph controls.
|
|
|
|
|
Dave Kreskowiak wrote: MSChart control isn't a good candidate for this problem. You'd be better off using a third party component to draw a scrolling line graph, or making your own control so you can have more control over exactly how it's drawn.
I don't think I could agree more.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I chose the RMChart control. It's quite powerful, it has good sample projects for VB6, and it's free.
http://www.rmchart.com[^]
-Nick
|
|
|
|
|
I've been using RMChart for a while now. They are great for static data, but they have problems with fast real-time data (especially when compared to NI Measurement Studio). Here's my thread on the RMChart forum about the real-time issues. It has some benchmark data:
http://www.rmchart.com/webpages/forum/forum_posts.asp?TID=400&PN=1[^]
I'm switching to NI Measurement Studio for plotting real-time date.
- Nick
|
|
|
|
|
Hello every one
I have a Vb.net 2005 Express application. I am using DataGridView and want the user to enter only numeric values in the Currency field and then format it also..
I tried
.DefaultCellStyle.Format = "C"
But still the I am able to type strings
How do I do it.
|
|
|
|
|
|
Thanks for the help Shimi
Can we not restrict the user from adding any string itself as we do for Masked Boxes...
|
|
|
|
|
You'd probably have to write your own DataGridView class at that point.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|