Click here to Skip to main content
15,889,826 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
code as follows;


SQl = "Select Bthid from startexec";
Dr = SCon.ReadSql(SQl);
string Bthid = Convert.ToInt16(Session["BthID"].ToString());
Response.Redirect("Instruction.aspx");

In database Bthid datatype is bigint

when i run shows error as follows

Cannot implicitly convert type 'short' to 'string'


for that how can i do?
Posted

1 solution

instead of string Bthid = Convert.ToInt16(Session["BthID"].ToString());

use either this:

Int16 Bthid = Convert.ToInt16(Session["BthID"].ToString());

or this

string Bthid = Session["BthID"].ToString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900