使用Session传递数据库值并重定向到另一个页面

问题描述:

数据库如下;



Database as follows;

Bthid  bigint (Datatype in the Database)

  Startexec table (Records as follows)

  Bthid

   718







我从Bthid传递数据库值来自Startexec表使用session并重定向到另一页。



我的代码如下;








I am passing the Bthid the database value from Startexec table using session and redirect to another page.

My code as follows;


SQl = "Select Bthid from startexec";
        BthID = TxtBthNo.Text.ToString().Trim();
        Session["Bthid"] = BthID;
        Response.Redirect("Instruction.aspx");





在数据库中Bthid数据类型是bigint



当我运行Error时如下;



无法将类型''string''隐式转换为''long''



for我怎么能用csharp做什么?



i多次试过但是没用?请帮帮我。''



如何解决?



问候,

Narasiman P



In database Bthid Datatype is bigint

When i run Error as follows;

Cannot implicitly convert type ''string'' to ''long''

for that how can i do using csharp?

i tried several times but it is not working? please help me.''

how can i solve?

Regards,
Narasiman P

尝试更改:



Try changing:

BthID = TxtBthNo.Text.ToString().Trim();











To

BthID = Convert.ToInt64(TxtBthNo.Text.Trim());