hi
i am getting tthe following error in the bold lile
stream was not readable
so plz tell me how to resolve it
Private
Strquery =
"Select * from optimizer"adp =
New SqlDataAdapter(Strquery, con)adp.Fill(ds,
"optimizer")cmdCommand =
New SqlCommand(Strquery, con) Trydr = cmdCommand.ExecuteReader
fs =
New FileStream("c:/abc.txt", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None)sr =
New StreamReader(fs) For Each dr In ds.Tables()sw.WriteLine(dr(0).ToString +
"/t" + dr(1).ToString) Nextsw.Close()
sr.Close()
dr.Close()
Catch ex As ExceptionMessageBox.Show(ex.Message +
" " + ex.StackTrace) End Try End Sub
Replies
Know the answer? Post it — somebody with the same question will find it here.