can someone please help me... I will be completely honest here... I have no freaking cute how to really use the datagrid and none of my books have been any help... is there any way to retreive data using inner joins and then place the information into the datagrid and format the header text and the columns themselves so that if it's null to just clear it and to have it readonly... here's me code along with a screen shot of what i still come up with... i'm pulling what hair that i have left out here.... please i'm on my knee help!!!
the code is just for testing until i figure this out.
VB Code:
Private Sub InitialDataGrid() Dim ds As New DataSet Dim sql As New StringBuilder With sql .Append("SELECT library_tbl.library_name, library_tbl.address1, ") .Append("library_tbl.address2, location_tbl.city, location_tbl.state, ") .Append("location_tbl.ZIPCODE, library_tbl.phone, library_tbl.fax ") .Append("FROM location_tbl INNER JOIN library_tbl ON ") .Append("location_tbl.ZIPCODE = library_tbl.LOCATION_ID") End With Dim daLibs As New OleDb.OleDbDataAdapter(sql.ToString, cn) daLibs.Fill(ds) Me.DataGrid1.DataSource = ds Dim dgtsInfo As New DataGridTableStyle With dgtsInfo .MappingName = "library_tbl" Dim dgtbcCity As New DataGridTextBoxColumn With dgtbcCity .HeaderText = "City" .MappingName = "loction_tbl.city" .NullText = "" .ReadOnly = True End With .GridColumnStyles.Add(dgtbcCity) End With Me.DataGrid1.TableStyles.Add(dgtsInfo) End Sub
screen shot of what i actually get





Reply With Quote