本文介绍了从vb到c#的代码转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
将一行代码c#转换为VB时出现错误
代码是
在vb:CType(MyUserControl.FindControl("txtid"),TextBox).Text =(CType(Val(mo.maxrows(从provider_master中选择max(supplier_id)max))),整数)+ 1)

转换后,代码变为((TextBox)MyUserControl.FindControl("txtid")).Text =(Convert.ToInt32( .Val(mo.maxrows( 从Supplier_master中选择max(supplier_id)")))+ 1);
但问题是我在转换"附近遇到错误.指出Conversion不在当前上下文中.

Hello,
I am getting An error while converting a line of code c# to VB
the code is
in vb:CType(MyUserControl.FindControl("txtid"), TextBox).Text = (CType(Val(mo.maxrows("select max(supplier_id) from supplier_master")), Integer) + 1)


after conversion the code become like this ((TextBox)MyUserControl.FindControl("txtid")).Text = (Convert.ToInt32(.Val(mo.maxrows("select max(supplier_id) from supplier_master"))) + 1);
but the problem is that i am getting a error near Conversion. sating that Conversion is not in the current context.
will any one help me about this.

推荐答案



这篇关于从vb到c#的代码转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 10:21