I am currently working on getting
Please find the respective Data Access Layer code below;
public void UpdateUser(PersonDTO bPerson)
using (SqlConnection conn = new SqlConnection(_connStr))
using (var dCmd = new SqlCommand(@"UPDATE Person SET...
I am trying to implement the update data record(s) from a data grid view to the database table.
I got three Layers implemented and need to update changes to the data grid view data using a data table into my database table.
In my Data Access Layer, the respective code looks like below...
I am trying to get my head around how the 3-layer architecture works using a sample example.
I am able to get the data on to the Presentation Layer, Form_Load event.
Please refer my below code,
private void Product_Details_Load(object sender...
I got a Data Table which is generated at the Form_Load event. The data then populate in to a dataGridView.
The user is allowed to add values to a dataGridView column (issueQuantity) and when saving the data, I want to update two tables in the SQL server.
However, when I'm running the...
I am running a WindowForm application and got a dataGridView where I add a new column(type of boolean) into it, during the Form Load event to select the data rows.
The respective code is as follows;
//Add column for selection
I am working on a small application which got a dataGridView and the first columns got a "CheckBox".
My requirement is, if the user has selected/checked the records of the dataGridView, the said records should save in to the database table when hit the "Save" button.
However, i have come...
I got a dataGridView and the first column's column type is " DataGridViewCheckBoxColumn".
My requirement is, I want to pass the data from the dataGridView based on the checked item rows to the database.
My code looks like below and when running the application, I am getting the "Object...
I got a combo box and a datagridview and my requirement is, based on the user's selection of an item in the combo box (Category Name), the respective product details should populate in to the dataGrid View.
I got two tables in SQL Server named, tbl_Product (ProductID, ProductName and...
I got three tables as shown below;
tbl_Product : ProdID, ProdName, Price
tbl_Department : DepartmentID, DepartmentName
tbl_Allocation : ProdID, DepartmentID
The requirement is, the products has to be allocated accordingly to the different departments (assume there are 10 products in...
I want to add a variable int value to a DataTable column. I have used one of the Microsoft's solution around DataTable to perform this task.
Basically, i got two tables in my SQL Server named, "BulkCopyDemoDifferentColumns" and "BulkCopyDemoMatchingColumns" and the intention is, I want...
This is more related to SQL and apologies in advance . However, since I need to clarify this, thought of posting this under the general discussion.
I got an issue while trying to execute multiple INSERT queries to SQL database.
The error was, "There is already an open DataReader associated...
I got a table (Table1) which got few fields and among them are "costCentreID" which is the PK and the "costCentreName".
I got another table(Table2) which got some transaction related data (which got "costCentreID" as a field) and my requirement is to load the data, based on a selection...
Thanks for the above respond.
Now, my requirement is to retrieve a single string value from the database based on the variable value I collected at the user login point.
Basically, I want to get the "costCentreCode" which relates to individual user and pass it to a textbox.
I got a small application and need to store the user's login details (ex - user name) into a static variable.
I created a class named, "UserData" and it looks like below;
public class UserData
public static string userName;
I need to access the "userName"...
I got an issue with converting dataGridView Data in to text prior to save the data into a SQL DB.
Basically, I want to use the parameters to pass the data into the DB and finding it bit difficult to work around that.
My code is as follows;
I got an error stating, " Input string was not in a correct format" when trying to insert a window form data in to a SQL database table.
I got a combobox named "cmbCostCentre" and when the user selects a cost centre, the respective Cost Centre ID is retrieved to another textbox named...
I got a dataGridView which got the following fields,
orderID, drugID, requestquantity and balancequantity
MyDataGridView looks like below;
The above said data is loaded from a SQL DB table.
What I want to perform is, whenever a user enter a value in to the "Issue Quantity" column...
I am developing an app to manage stocks.
I am loading drug orders related data into a window form (basically to a dataGridView) and need to calculate the sum of a column. For the said, purpose, I am using the below code within the FormLoad event;
int d = 0;
for(int n=0; n<...
I am new to visual C# and currently working on developing an application.
I got a data base table which got a integer field named "orderID" and I want to access the data relating to a given integer variable which matches with the respective orderID value.
For example, I have declared...