我想创建一个搜索页面根据3字段并向我显示像他们这样的记录 may functon
CREATE FUNCTION [dbo].[Fun_SeachCustomers]
(
@CName nvarchar(450) ,
@mobile varchar(15),
@State int
)
RETURNS TABLE
AS
RETURN
(
SELECT
CEmail email
,CName name
,CorpName cropname
,Jens gender
,mobile mobile
FROM TBLCustomers
WHERE CName LIKE @CName OR mobile LIKE @mobile OR State LIKE @State)
我希望在网格视图和表格单元格中显示此字段 我的代码
SqlCommand cmd = new SqlCommand("SELECT email, name, cropname, gender, mobile FROM dbo.Fun_SeachCustomers(@CName, @mobile, @State) AS Fun_SeachCustomers_1", conn);
cmd.Parameters.AddWithValue("@CName", txtName.Text);
cmd.Parameters.AddWithValue("@mobile", txtmobile.Text);
cmd.Parameters.AddWithValue("@State", rbl.SelectedValue);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
ResGrid.DataSource = da;
ResGrid.DataBind();
ResGrid.Visible = true;
gird view不显示任何东西 我不知道如何在表格的单元格中显示记录