Hi all, pls i need your help, i am trying to execute a query and put all the retrieved data in a data set, but i get this error " cannot implicitly convert type 'int' to 'system.data.dataset'".
Here's the code
String Astra_conn = ConfigurationManager.ConnectionStrings["AstraSeverConnection"].ConnectionString;
System.Text.StringBuilder sql = new System.Text.StringBuilder();
this is a small piece of the sql
sql.Append(" SELECT ROWNUM AS ID, institution, LPAD (a.zone_name, 3, '0') AS campus, ");
sql.Append(" term_name AS term, student_instance_id AS student_id, subject, course, ");
sql.Append(" section_name AS section_num, offering AS title, ");
Its OracleConnection because it is an Oracle server otherwise, it would be SqlConnection.
DataSet rs = new DataSet();
OracleConnection Astra_db_Conn = new OracleConnection(Astra_conn);
string myquery = sql.ToString();
OracleCommand cmd = new OracleCommand(myquery);
Astra_db_Conn.Open();
try
{
SqlDataAdapter adpt = new SqlDataAdapter();
rs = cmd.ExecuteNonQuery();
adpt.Fill(rs);
}
catch(Exception e)
{
log.Error("*** ERROR *** IRISExportQueries.loadStudentInfoLearningSites():" + e);
}
I have also tried
Astra_db_Conn.Open();
try
{
SqlDataReader reader = new SqlDataAdapter();
reader = cmd.ExecuteNonQuery();
}
catch(Exception e)
{
log.Error("*** ERROR *** IRISExportQueries.loadStudentInfoLearningSites():" + e);</pre>
}
But then i get the error: "cannot implicitly convert type
'int'
to
'System.Data.SqlClient.SqlDataReader'
".
Thanks your help will be very much appreciated.