C
Chicagoboy27
Sorry if this is a basic question but I was wondering how to test the
data being read back from a database. I am using a datareader currently
and am not sure if that is the best route. In classic asp it went
along the lines of setting up the recordset and testing the recordset
information as it was being written. I am not sure what is it is using
asp.net though.
Here is my current scenerio
ex, I have a table that contains file extentions such as .xls, .doc,
..ppt. What I want to do is test the dataset as they are being written
and if the dataset is equal to .xls i want it to be excel..
I am new to this and am able to connect to the table but I just can
seem to get a handle on how to test the current data being retrieved to
make
any changes. like having the record be .xls and me test for that and
replace it with excel any bump in the right direction would be helpful
....
thanks in advance
currently here is the code I have so far
SqlConnection myConnection = new SqlConnection();
try
{
myConnection.ConnectionString =
ConfigurationManager.ConnectionStrings["pubsConnectionString"].ConnectionString;
string strCommand = "SELECT * FROM FILE2";
SqlCommand myCommand = new SqlCommand(strCommand,
myConnection);
myConnection.Open();
GridView2.DataSource = myCommand.ExecuteReader();
GridView2.DataBind();
}
finally
{
myConnection.Close();
}
data being read back from a database. I am using a datareader currently
and am not sure if that is the best route. In classic asp it went
along the lines of setting up the recordset and testing the recordset
information as it was being written. I am not sure what is it is using
asp.net though.
Here is my current scenerio
ex, I have a table that contains file extentions such as .xls, .doc,
..ppt. What I want to do is test the dataset as they are being written
and if the dataset is equal to .xls i want it to be excel..
I am new to this and am able to connect to the table but I just can
seem to get a handle on how to test the current data being retrieved to
make
any changes. like having the record be .xls and me test for that and
replace it with excel any bump in the right direction would be helpful
....
thanks in advance
currently here is the code I have so far
SqlConnection myConnection = new SqlConnection();
try
{
myConnection.ConnectionString =
ConfigurationManager.ConnectionStrings["pubsConnectionString"].ConnectionString;
string strCommand = "SELECT * FROM FILE2";
SqlCommand myCommand = new SqlCommand(strCommand,
myConnection);
myConnection.Open();
GridView2.DataSource = myCommand.ExecuteReader();
GridView2.DataBind();
}
finally
{
myConnection.Close();
}