Have you not been given any training at all?
Do you know how to use Visual Studio to start a project?
Your first task before you code anything is to identify the objects. They become your classes the first obvious one is 'Colleague' do you know how to create a class in VB.NET?
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
to code in datagrid...
just drag& drop it from toolbox& to colour the datagrid based on the there sales(with orange,green,yellow...etc).use datagrid_itemdatabound function....
--------------------------write this code in pageload& just drop datagrid on form,,,
Private Sub LoadData()
Dim strSQL As String = "SELECT * FROM table1 order by ID "
Dim cnn As String = ConfigurationSettings.AppSettings("preeconn")
Dim cmd As New SqlCommand(strSQL, New SqlConnection(cnn))
cmd.Connection.Open()
Dim myCommand As New SqlDataAdapter(strSQL, cnn)
Dim ds As New DataSet
myCommand.Fill(ds, "table1")
datagrid1.DataSource = cmd.ExecuteReader
Dim sumTotal As Integer
sumTotal = ds.Tables(0).Compute("SUM(Age)", String.Empty).ToString
datagrid1.Columns(2).FooterText = "TOTAL: "
datagrid1.Columns(3).FooterText = sumTotal
datagrid1.DataBind()
cmd.Connection.Close()
cmd.Connection.Dispose()
End Sub
--------------And for datagrid_itemdatabound...then use this function..manipulate the functions based on ur requirements,,,
ProtectedSub datagrid1_itemdatabound(ByVal sender AsObject, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles datagrid1.ItemDataBound
If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim value AsString = Trim(e.Item.DataItem("Sex"))
If Len(value) = 4 Then
e.Item.BackColor = System.Drawing.Color.Chocolate ' i is the index of the particular column
' 'e.Item.Cells(4).Text = "hai"
End If
End If
------------------if u have any prblm,just scrap it over here& w will solve it.....
preetham.saroja
Junior Poster in Training
82 posts since Jun 2007
Reputation Points: 5
Solved Threads: 1