using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class QianFei_QianfeiXiangxi : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string name = Request["name"];
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select * from tb_qianfei where name='" + name + "'";
cmd.ExecuteNonQuery();
SqlDataReader sdr = cmd.ExecuteReader();
sdr.Read();
if (name!= "")
{
this.lblqfname.Text = sdr.GetString(0).ToString();
this.lblzz.Text = sdr.GetString(1);
this.lbllb.Text = sdr.GetString(2);
this.lblrqzs.Text = sdr.GetDateTime(3).ToShortDateString();
this.lblzzsj.Text = sdr.GetDateTime(4).ToShortDateString();
this.lblje.Text = sdr.GetFloat(5).ToString();
this.Lblzt.Text = sdr.GetString(6).ToString();
this.lbljsr.Text = sdr.GetString(7).ToString();
}
else
{
Response.Write("暂无主题,不能显示");
Response.Redirect("~/Default.aspx");//将该页跳转到指定的页面中
}
详细解决方案
错误详细信息: System.InvalidCastException: 指定的转换无效
热度:9259 发布时间:2013-02-25 00:00:00.0
相关解决方案
- System.setProperty("javax.net.ssl.keyStore 多个其间冲突
- 关于 System.getProperty("audio.encodings");该怎么处理
- 关于JSR75开发 怎么查到 system root name。多谢
- javax.xml.soap.SOAPException: System.Web.Services.Protocols.
- System.arraycopy()的1点疑问
- 为什么虚拟串口安装了不能用 显示“Unable loading system driver ,the application will be eixt.”解决办法
- System.out.println(1.001*1000)输出结果为什么是1000.99999999?解决方法
- 问个弱智 System.in.read()有关问题
- System.out.println(3L == 3f);结果为什么为true解决思路
- system.out.println(-8>>>2),输出1073741822。求解释。多谢
- System.out.write()输出不显示有关问题
- System.out.println(3/2>一);输出什么
- 错误详细信息: System.Data.OleDb.OleDbException: 表 'table_user' 已存在
- System.Security 命名空间解决方法
- 错误详细信息: System.Data.OleDb.OleDbException: 表 'table_user' 已存在
- System.InvalidCastException:Unable to cast COM object of type 'System.
- System.ComponentModel.Description 这个属性为何不起作用
- System:String 转 std上的string
- 一个关于“不能将参数 1 从“char [80]”转换为“System:Object ^”的有关问题
- System:String 转 std下的string解决办法
- 无法在 System.String 和 System.Int64 上执行“=”操作。解决思路
- System:String转换有关问题
- System.ArgumentNullException 以及 Array的CopyTo 有关问题
- 创建什么项目才能 运行using namespace System;解决办法
- dll跟test.exe放在一起,否则就会报“System.IO.FileNotFoundException”
- System.NullReferenceException: 未将对象引用设置到对象的实例。
- 如何把“char *”转换为“System:String ^”
- System.out.println ( 'A' +20.5 );的运行结果是85.5,该如何解决
- j# 里如何定义和 C#同样功能的 override void DefWndProc(ref System.Windows.Forms.Message m) 多谢,很
- System.out.println ( 'A' +20.5 );的运作结果是85.5