To get this to work like you think it would work is:
public int[] searchClaim(string ClaimID)
{
OleDbConnection con = new OleDbConnection(connect);
con.Open();
try
{
string sql = "SELECT * FROM Claim WHERE ClaimID =" + ClaimID + "";
OleDbCommand command = new OleDbCommand(sql, con);
OleDbDataReader reader = command.ExecuteReader();
reader.Read();
int[] dbResult = new int[5];
dbResult[0] = 1;
dbResult[1] = reader[0];
dbResult[2] = reader[1];
dbResult[3] = reader[2];
dbResult[4] = reader[3];
con.Close();
return dbResult; }
catch
{
throw new Exception();
}
finally
{
if (con != null)
{
con.Close();
}
}
}
It would appear that you are getting int datatypes from your database so you need an int array not an Int64. int != Int64 && int != string
As losmac rightfully pointed out, this would only work this way IF your database schema is setup with int datatypes. If your datatypes are mixed, this will not work.