Wednesday, March 7, 2012

Help with outer join query please!

I have a MSDE query that includes a "left outer join..." clause. It runs fine in MSDE Query (a 3rd party GUI tool) and produces 12 rows. column 3 has some NULL values (because of the outer join).

But when I use the same query in an ASP.NET page, and display the result in a datagrid, it only displays 7 rows - the rows with the NULL value in column 3 do not display.

Is there a parameter somewhere in datagrid or dataset that I should be setting?

thank you someone!there should be an AllowDbNull afaik|||


private void AddNullAllowedColumn(){
DataColumn myColumn;
myColumn = new DataColumn("classID", System.Type.GetType("System.Int32"));
myColumn.AllowDBNull = true;
// Add the column to a new DataTable.
DataTable myTable;
myTable = new DataTable();
myTable.Columns.Add(myColumn);
}

maybe a foreach (DataColumn column in DataGrid.Columns) { or datatable.
you can specify that.

No comments:

Post a Comment