cannot implicitly convert type 'string' to 'int' in c# Windows Application
private int billno(string p)
{
string Billno = "0";
cmd = new SqlCommand(p, con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
Billno = reader[0].ToString();
}
reader.Close();
return Billno;
con.Close();
}
private void btn_Insert_Click(object sender, EventArgs e)
{
int Billno = billno("Select ISNULL(Max(Billno+1),1) From MainBillForm");
}


Karthi KeyanRank #1,926 · 762 reputationPosted Apr 10, 2017, 9:09 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Apr 10, 2017, 9:08 PM EDT
Karthi KeyanRank #1,926 · 762 reputationPosted Apr 10, 2017, 9:38 PM EDT
Gnanavel SekarRank #333 · 7.5K reputationPosted Apr 10, 2017, 10:47 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Apr 10, 2017, 10:50 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Apr 10, 2017, 10:50 PM EDT
Gnanavel SekarRank #333 · 7.5K reputationPosted Apr 10, 2017, 10:55 PM EDT
Bidyasagar MishraRank #766 · 3K reputationPosted May 3, 2017, 10:44 PM EDT
Jyoti JodhaRank #1,408 · 1.2K reputationPosted Apr 10, 2017, 9:36 PM EDT
Jyoti JodhaRank #1,408 · 1.2K reputationPosted Apr 10, 2017, 10:50 PM EDT
Jyoti JodhaRank #1,408 · 1.2K reputationPosted Apr 10, 2017, 10:57 PM EDT
Nitin Sontakke
Gnanavel Sekar
Karthi Keyan
Jyoti JodhaRank #1,408 · 1.2K reputationPosted Apr 11, 2017, 2:23 AM EDT