E
Edward van Nijmweegen
Hello,
I developing some code that will select a few value and together they will
be presented in a table (datagrid). But i have the following
issues/question:
1. How can i add just one row to a grid (header and previous added row
should stay)?
2. I have 4 string and 1 numeric variables that i want to put together as
one row into the table, how can i handle them (they are not part of a
database.
3. How can i count a collumn inside this datagrid ???
Below you see a part of my code.
thanks
--
Edward van Nijmweegen
Dim dsFinal As New DataSet
Dim daFinal As OleDbDataAdapter
Dim conn As OleDbConnection
Dim strConn As String
Dim strSQLFinal As String
strConn = "Provider = microsoft.jet.OLEDB.4.0;"
strConn &= "Data Source = c:\Pricelist\pricelist.mdb;"
strSQLFinal = "SELECT fldID, fldArtikelnummer, "
strSQLFinal = strSQLFinal + " fldOmschrijving, fldPrice, "
strSQLFinal = strSQLFinal + " fldCode, fldLanguage, "
strSQLFinal = strSQLFinal + " fldLicensecount, fldBusinessunit, "
strSQLFinal = strSQLFinal + " fldLevel, fldProductfamily, "
strSQLFinal = strSQLFinal + " fldVolumelevel, fldPool, fldItem "
strSQLFinal = strSQLFinal + " FROM tblPriceList"
strSQLFinal = strSQLFinal + " WHERE fldID = " & cboProduct.SelectedIndex
conn = New OleDbConnection(strConn)
conn.Open()
daFinal = New OleDbDataAdapter(strSQLFinal, conn)
daFinal.Fill(dsFinal)
....
....
<All kind of calculations>
....
....
DataGrid1.DataSource = dsFinal.Tables("tblPriceList")
DataGrid1.DataMember = "tblPriceList"
....
....
<My issue>
.....
.....
conn3.Close()
conn3 = Nothing
I developing some code that will select a few value and together they will
be presented in a table (datagrid). But i have the following
issues/question:
1. How can i add just one row to a grid (header and previous added row
should stay)?
2. I have 4 string and 1 numeric variables that i want to put together as
one row into the table, how can i handle them (they are not part of a
database.
3. How can i count a collumn inside this datagrid ???
Below you see a part of my code.
thanks
--
Edward van Nijmweegen
Dim dsFinal As New DataSet
Dim daFinal As OleDbDataAdapter
Dim conn As OleDbConnection
Dim strConn As String
Dim strSQLFinal As String
strConn = "Provider = microsoft.jet.OLEDB.4.0;"
strConn &= "Data Source = c:\Pricelist\pricelist.mdb;"
strSQLFinal = "SELECT fldID, fldArtikelnummer, "
strSQLFinal = strSQLFinal + " fldOmschrijving, fldPrice, "
strSQLFinal = strSQLFinal + " fldCode, fldLanguage, "
strSQLFinal = strSQLFinal + " fldLicensecount, fldBusinessunit, "
strSQLFinal = strSQLFinal + " fldLevel, fldProductfamily, "
strSQLFinal = strSQLFinal + " fldVolumelevel, fldPool, fldItem "
strSQLFinal = strSQLFinal + " FROM tblPriceList"
strSQLFinal = strSQLFinal + " WHERE fldID = " & cboProduct.SelectedIndex
conn = New OleDbConnection(strConn)
conn.Open()
daFinal = New OleDbDataAdapter(strSQLFinal, conn)
daFinal.Fill(dsFinal)
....
....
<All kind of calculations>
....
....
DataGrid1.DataSource = dsFinal.Tables("tblPriceList")
DataGrid1.DataMember = "tblPriceList"
....
....
<My issue>
.....
.....
conn3.Close()
conn3 = Nothing