Please help, i have to finish this assignment ASAP.
the project is to create a solution with 3 text box for FactoryID, FactoryName and FactoryAddress. next is to create 2 Datagrid for Customer and Supplier.
Splash screen also create for start up the program.
i have created most of the program but could not figure it out how to get the relationsive to work between Factory, Customer and the supplier.
please reply.
8 1351
Welcome to TheScripts! Please read Homework Guidelines and post back with a specific problem. Thanks!
Welcome to TheScripts! Please read Homework Guidelines and post back with a specific problem. Thanks!
Thanks for the advice.
I have created form with text box (FactoryID, FactoryName and Address etc.)
and created 2 datagrid to display Customer info (FactoryID, CustomerID etc.) the second datagrid is Supplier (FactoryID, SupplierID etc.).
i have finished all of the above, created all the necessary connection (OleDbConnection, OleDbDatasdapter and Dataset) to the Main form.
MMuMain also created to navigate (First, Previous, next etc,). however when i click on next or previous the text box for the factoryID, address and name change accordingly, but the datagrid does not change according to the factory text box. like i had mentioned in the previous i have problems of understanding of how to setup the relationsive/or code?.
please advise.
Thanks for the advice.
I have created form with text box (FactoryID, FactoryName and Address etc.)
and created 2 datagrid to display Customer info (FactoryID, CustomerID etc.) the second datagrid is Supplier (FactoryID, SupplierID etc.).
i have finished all of the above, created all the necessary connection (OleDbConnection, OleDbDatasdapter and Dataset) to the Main form.
MMuMain also created to navigate (First, Previous, next etc,). however when i click on next or previous the text box for the factoryID, address and name change accordingly, but the datagrid does not change according to the factory text box. like i had mentioned in the previous i have problems of understanding of how to setup the relationsive/or code?.
please advise.
How have you tried changing the DataGrid?
Could you post a snippet of your code relating to this functionality so that we have a better idea of what you're doing?
Thanks
-Frinny
Below is the code from Main. Please asvice.
Below is the code from Main. Please asvice. -
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
Dim printRecords As Integer
-
Dim dgtsCustomer As New DataGridTableStyle()
-
Dim dgtsSupplier As New DataGridTableStyle()
-
Dim pbndTemp As Binding
-
Dim dtCustomers As DataTable
-
-
..
-
End Sub
-
-
-
-
Private Sub dgCustomer_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgCustomer.CurrentCellChanged
-
Dim drArray() As DataRow
-
Dim pintFactoryId As Integer
-
Dim pintCount As Integer
-
Dim pintFactoryName As String
-
Dim pintFactoryAddress As String
-
-
drArray = DsFactory.tblCustomer(dgCustomer.CurrentRowIndex).GetChildRows _
-
("drtblCustomer")
-
-
pintFactoryId = drArray.GetUpperBound(0) + 1
-
txtFactoryId.Text = pintFactoryId.ToString
-
-
txtFactoryId.Text = pintFactoryId.ToString
-
-
End Sub
It appears that you are taking the content from your data set and filling text boxes with the data.
I don't see where you are changing the view of the dataGrid.
I still don't understand your use of the "Next" and "Previous" buttons.
Are you using the Next and Previous buttons to allow the user to update data in your dataSet? Then want to update your dataGrid with this new data showing?
Can you not just use "RowEditing" and "RowUpdating" to allow the user to do their updating in the dataGrid?
I'm sorry but I still don't understand what you're trying to accomplish.
-Frinny
Here is the navigates for first, previous, next and last.
How can i change datagrid when i click on next or previous. should i create the relationship between factory, customer and supplier. please advice. -
Private Sub mmuNavigateFirst_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigateFirst.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position = 0
-
End Sub
-
-
-
Private Sub mmuNavigatePrevious_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigatePrevious.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position -= 1
-
End Sub
-
-
Private Sub mmuNavigateNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigateNext.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position += 1
-
-
End Sub
-
-
Private Sub mmuNavigateLast_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigateLast.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position = Me.DsFactory3.tblFactory.Rows.Count - 1
-
End Sub
-
Here is the navigates for first, previous, next and last.
How can i change datagrid when i click on next or previous. should i create the relationship between factory, customer and supplier. please advice. -
Private Sub mmuNavigateFirst_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigateFirst.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position = 0
-
End Sub
-
-
-
Private Sub mmuNavigatePrevious_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigatePrevious.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position -= 1
-
End Sub
-
-
Private Sub mmuNavigateNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigateNext.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position += 1
-
-
End Sub
-
-
Private Sub mmuNavigateLast_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mmuNavigateLast.Click
-
Me.BindingContext(DsFactory3, "tblfactory").Position = Me.DsFactory3.tblFactory.Rows.Count - 1
-
End Sub
-
Please check out MSDN's article on DataGrids and their members and MSDN's Article on DataGrid Events.
I cannot understand your problem.
A dataGrid shows many rows...not just one...so there's no need to use "next' and "previous".
A dataGrid could show all of the rows in your dataSet if you'd like it to...then users just have to glance through the dataGrid to find the row that they'd want to edit.
A dataGrid also has Paging functionality......which can take you to the first row or the last row in the dataGrid.
Why can't you just use the update functionality that is built into the dataGrid? Let the user look at the information in the grid, let them select "edit"...let them edit the information inside the grid....This will simplify your problem quite a bit.
I'm going to ask other experts to take a look at your problem and hopefully we can help you get through this.
-Frinny
Why dunt u try Gridview Paging...
Set Allowpaging true
then write the code in vb Page.....
Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
Me.GridView1.PageIndex = e.NewPageIndex
fillgrid() [Call the fuction to fill gridview]
End Sub
It may solve ur problem
Sign in to post your reply or Sign up for a free account.
Similar topics
by: cwbp17 |
last post by:
Have two tables that have a FK relationship on ID column.
Have one datagrid that displays all of the columns of both tables.
What's the best approach on updating a row from the datagrid back to...
|
by: A P |
last post by:
Hi!
I'm a new user of VB.NET 2003 and still learning its feature, one of them is
datagrid. I am using Access 2002 Database on my project and trying to update
values of a table using datagrid...
|
by: A P |
last post by:
Hi!
I have created a sample datagrid that can update data on a database. Please
help me solve the problem, I have attached both aspx and code behind
(aspx.vb):
______________________
...
|
by: A P |
last post by:
Hi!
I'm a new user of VB.NET 2003 and still learning its feature, one of them is
datagrid. I am using Access 2002 Database on my project and trying to update
values of a table using datagrid...
|
by: cwbp17 |
last post by:
Have two tables that have a FK relationship on ID column.
Have one datagrid that displays all of the columns of both tables.
What's the best approach on updating a row from the datagrid back to...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |