First off, you will need to change the SQL statement that is populating your datagrid to something similar to:
SELECT TABLE.Col1, TABLE.Col2, TABLE.Col1*TABLE.Col2 AS Col3 FROM TABLE;
Then for summing Col3 to a textbox you will need to write a for loop. Something similar to:
Dim drrow As DataRow For Each drrow In DataSet1.Tables("TABLENAME").Rows total = total + double.parse(DataSet1.Tables("TABLENAME").Rows(introw).Item("Col3")) introw += 1 Next 'Now just store that total in the textbox
Thank you every much for your code. They are working alright. I would like to ask one more question.
Also I’m having a problem when I enter a new value to datagrid manually.
Is there any way that I can calculate this without connecting to database(SQL).
txtTotal = datagrid1.column(3).(items)
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...