hey,
does anyone know how to handle this exception?
please help me
//Retrieves all the contract numbers from the Contract table
public String[] getPhaseNumbers(String TopicNo)
{
db.openConnection();
String query = @"Select Phase From Topic Where TopicNo = @topicNo";
SqlCommand command = new SqlCommand(query, DB.getConnection());
command.Parameters.Add("@topicNo",SqlDbType.Int).Value = TopicNo;
SqlDataAdapter da = new SqlDataAdapter(command);
DataTable dt = new DataTable();
[B] da.Fill(dt);
[/B]
int NoOfRows = dt.Rows.Count;
String[] phase = new String[NoOfRows];
for (int i = 0; i < dt.Rows.Count; i++)
{
phase[i] = dt.Rows[i]["Phase"].ToString();
}
db.closeConnection();
return phase;
}
from the place the code is bolded it says "Failed to convert parameter value from a String to a Int32."
why is this
w@ is the solution for this ?
please give me an answer?
thankxxxxxxxxxx