Debug the code and use the the Breakpoint when u fill the dataset with data. and write immediately ds.Tables(0).Rows.count in the immediate Window. Also Check the name and Data of ur table.