<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <style type="text/css">
        .style1
        {
            width: 154px;
        }
        .style2
        {
            width: 238px;
        }
        .style3
        {
            width: 30px;
        }
        .style4
        {
            width: 86px;
        }
    </style>
</head>
<body>
    <form id="form2" runat="server">
    <div style=" text-align:center;">
        <div>
            <table border="0" width="1000">
                <tr>
                    <td align="center" colspan="2" style="font-size:30px">
                        上海烜炀生物科技有限公司</td>
                </tr>
                <tr>
                    <td align="center" style="font-size:30px" width="839">
                             派车申请单</td>
                    <td style="font-size:30px; text-align:left" width="151">
                        NO</td>
                </tr>
            </table>
        </div>        <br />
        <table border="1" height="157" width="1000" style="text-align:left">
            <tr>
                <td colspan="2" height="18">
                    申请日期: 
                    <script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
                    <asp:TextBox ID="TextBoxF_AppDate" runat="server"></asp:TextBox>                </td>
                <td colspan="2" height="18">
                    申请部门:<asp:TextBox ID="TextBoxF_AppDeptName" runat="server"></asp:TextBox>
                </td>
                <td height="18">
                    申请人:<asp:TextBox ID="TextBoxF_AppEmpName" runat="server"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td colspan="4" rowspan="2">
                    使用事由:<asp:TextBox ID="TextBoxF_UseReason" runat="server"></asp:TextBox>
                    </td>
                <td width="287">
                    地点:<asp:TextBox ID="TextBoxF_Destination" runat="server"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td>
                    内部车:内部车:</td>
            </tr>
            <tr>
                <td colspan="4">
                    用车时间:<asp:TextBox ID="TextBoxF_OutTime" runat="server"></asp:TextBox>
                    </td>
                <td>
                    返回时间:<asp:TextBox ID="TextBoxF_BackTime" runat="server"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td colspan="3">
                    起点公里数:<asp:TextBox ID="TextBoxF_StartKM" runat="server"></asp:TextBox>
                    </td>
                <td colspan="2">
                    终点公里数:<asp:TextBox ID="TextBoxF_EndKM" runat="server"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td colspan="3">
                    使用时间:<asp:TextBox ID="TextBoxF_UseTime" runat="server"></asp:TextBox>
                    </td>
                <td colspan="2">
                    使用公里数:<asp:DropDownList ID="DropDownList1" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    主管核准:</td>
                <td class="style3">
                    &nbsp;</td>
                <td class="style1">
                    出车司机:</td>
                <td class="style4">
                    &nbsp;</td>
                <td>
                    用车人</td>
            </tr>
        </table>    <div >
        第一联&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 司机&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (用车人)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        第二联&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 存根&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( 出纳)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 表单编号&nbsp; :CW0010&nbsp; </div>
&nbsp; 
    </div>
    <asp:Button ID="Button1" runat="server" Text="确定" onclick="Button1_Click"/>
        <br />
    </form>
    </div>
    </form>
</body>
</html>

解决方案 »

  1.   

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using DLL;
    using System.Data.SqlClient;
    using System.Data;namespace BLL
    {
        public class GETt_usecarListManager
        {
            GETt_usecarListService t_usecarListService = new GETt_usecarListService();
            public DataSet gett_usecarList(string sql)
            {
                DataSet ds = new DataSet();
                ds = t_usecarListService.gett_usecarList(sql);
                return ds;
            }
        }
    }using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.SqlClient;
    using System.Data;namespace DLL
    {
        public class GETt_usecarListService
        {
            public DataSet gett_usecarList(string sql) 
            {
                DataSet ds = new DataSet();
                ds = DBHelper.GetSelect(sql);
                return ds;
            }
        }
    }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    using System.Data.SqlClient;
    using MODELS;
    using System.Configuration;namespace DLL
    {
        public class DBHelper
        {
            private static string GetSqlConnection()
            {
                string sqlConnection = ConfigurationManager.ConnectionStrings["AVW_OfficeConnectionString"].ToString();            return sqlConnection;
            }
            public static DataSet GetSelect(string sql)
            {            string connstring = GetSqlConnection();
                SqlConnection sqlCon = new SqlConnection(connstring);
                sqlCon.Open();            DataSet ds = new DataSet();
                SqlCommand sqlCmd = new SqlCommand(sql, sqlCon);            SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);            //SqlDataAdapter sqlDa = new SqlDataAdapter(sql, sqlCon);
                //SqlCommand sqlCmd = new SqlCommand(sql);
                DataTable dt = new DataTable();
               
                sqlDa.Fill(ds,"dt");            sqlCon.Close();
                sqlCon.Dispose();            sqlCon.Close();
                sqlCon.Dispose();
                return (ds);        }        public static int insertData(string sql) 
            {
                string connstring = GetSqlConnection();
                SqlConnection sqlCon = new SqlConnection(connstring);
                sqlCon.Open();
                SqlCommand sqlCmd = new SqlCommand(sql,sqlCon);
                int id = 0;
                id = sqlCmd.ExecuteNonQuery();
                sqlCon.Close();
                sqlCon.Dispose();            sqlCon.Close();
                sqlCon.Dispose();
                return id;
            }
        }
    }
    怎么办秋高手啊
      

  2.   

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Data.SqlClient;
    using BLL;
    using MODELS;
    using System.Collections.Generic;public partial class Default3 : System.Web.UI.Page
    {
        GETt_usecarListManager t_usecarListManager = new GETt_usecarListManager();    protected void Page_Load(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();
            t_usecarListManager.gett_usecarList("select * from t_usecarList where F_AppDeptName='经理室' ");        this.TextBoxF_AppDate.Text = ds.Tables[0].Rows[0]["F_AppDate"].ToString();
            this.TextBoxF_AppDeptName.Text = ds.Tables[0].Rows[0]["F_AppDeptName"].ToString();
            this.TextBoxF_AppEmpName.Text = ds.Tables[0].Rows[0]["F_AppEmpName"].ToString();
            this.TextBoxF_UseReason.Text = ds.Tables[0].Rows[0]["F_UseReason"].ToString();
            this.TextBoxF_Destination.Text = ds.Tables[0].Rows[0]["F_Destination"].ToString();
            this.TextBoxF_OutTime.Text = ds.Tables[0].Rows[0]["F_OutTime"].ToString();
            this.TextBoxF_BackTime.Text = ds.Tables[0].Rows[0]["F_BackTime"].ToString();
            this.TextBoxF_StartKM.Text = ds.Tables[0].Rows[0]["F_StartKM"].ToString();
            this.TextBoxF_EndKM.Text = ds.Tables[0].Rows[0]["F_EndKM"].ToString();
            this.TextBoxF_UseTime.Text = ds.Tables[0].Rows[0]["F_UseTime"].ToString();
        
        }
      }
      

  3.   

    没读出数据来          没有判断 是否是null  并且是否 数据条数是否大于0
      

  4.   

    if(ds.Tables[0]!=null&&ds.Tables[0].Rows.Count>0)
    {
      this.TextBoxF_AppDate.Text = ds.Tables[0].Rows[0]["F_AppDate"].ToString();
      this.TextBoxF_AppDeptName.Text = ds.Tables[0].Rows[0]["F_AppDeptName"].ToString();
      this.TextBoxF_AppEmpName.Text = ds.Tables[0].Rows[0]["F_AppEmpName"].ToString();
      this.TextBoxF_UseReason.Text = ds.Tables[0].Rows[0]["F_UseReason"].ToString();
      this.TextBoxF_Destination.Text = ds.Tables[0].Rows[0]["F_Destination"].ToString();
      this.TextBoxF_OutTime.Text = ds.Tables[0].Rows[0]["F_OutTime"].ToString();
      this.TextBoxF_BackTime.Text = ds.Tables[0].Rows[0]["F_BackTime"].ToString();
      this.TextBoxF_StartKM.Text = ds.Tables[0].Rows[0]["F_StartKM"].ToString();
      this.TextBoxF_EndKM.Text = ds.Tables[0].Rows[0]["F_EndKM"].ToString();
      this.TextBoxF_UseTime.Text = ds.Tables[0].Rows[0]["F_UseTime"].ToString();
    }
      

  5.   

    select * from t_usecarList where F_AppDeptName='经理室' 你将这个放到 查询分析器里运行一下看看。