D
DENTONE
Hello,
I have writed this code to file a dataset table with data from a sql table
Dim connstring As String = "Data Source=serverhacpack;Initial
Catalog=master;User ID=HACPACK;Password=francesca"
Dim conn As New SqlConnection((connstring))
conn.Open()
Dim dataSet1 As New DataSet("MERCI")
Dim dataAdapter As New SqlDataAdapter()
dataAdapter.SelectCommand = New SqlCommand("SELECT
[SIGLACONT],[sostanza],[ONU],[CLASSE1],[PG],[NETTOCONT],[N_COLLI],[EMS],[flag]
FROM " + tableName + " Where ([NAVE]='" + Session("nave") + "' AND
[IDVIAGGIO]='" + Session("id") + "')", conn)
dataAdapter.Fill(dataSet1, "MERCI")
dataSet1.Tables(0).Columns.Add("TIPO") ' adding the column TIPO
Return dataSet1.Tables(0)
I have added a column to the table (TIPO) now i want that this column was a
calculeted column , i want that :
-if the filed flag is 0 the TIPO colums become "TRANSITO"
-if the filed flag is 1 the TIPO colums become "IMBARCO"
-if the filed flag is 2 the TIPO colums become "SBARCO"
Thank's for the Help
I have writed this code to file a dataset table with data from a sql table
Dim connstring As String = "Data Source=serverhacpack;Initial
Catalog=master;User ID=HACPACK;Password=francesca"
Dim conn As New SqlConnection((connstring))
conn.Open()
Dim dataSet1 As New DataSet("MERCI")
Dim dataAdapter As New SqlDataAdapter()
dataAdapter.SelectCommand = New SqlCommand("SELECT
[SIGLACONT],[sostanza],[ONU],[CLASSE1],[PG],[NETTOCONT],[N_COLLI],[EMS],[flag]
FROM " + tableName + " Where ([NAVE]='" + Session("nave") + "' AND
[IDVIAGGIO]='" + Session("id") + "')", conn)
dataAdapter.Fill(dataSet1, "MERCI")
dataSet1.Tables(0).Columns.Add("TIPO") ' adding the column TIPO
Return dataSet1.Tables(0)
I have added a column to the table (TIPO) now i want that this column was a
calculeted column , i want that :
-if the filed flag is 0 the TIPO colums become "TRANSITO"
-if the filed flag is 1 the TIPO colums become "IMBARCO"
-if the filed flag is 2 the TIPO colums become "SBARCO"
Thank's for the Help