.net中怎样用c#(必须)分页时传递sql语句

来源:百度知道 编辑:UC知道 时间:2024/06/22 01:49:16
用getset时中是得初始化一出示话就没了
这位大哥,我是新手,你说得详细点不行private string M_Text = "";
public string cmdText
{ get
{
return M_Text;
}
set
{
M_Text = value;
}
}
初始化后赋值 text1.cmdText = "select。。。。"
其他地方掉用ShowVipPj(text1.cmdText.ToString());
什么是委托这个词我不知道什么意思,还没学过。

你可以定义个委托!!

委托你会写撒?
会的话往下看:
你先定义一个委托:
然后在需要传sql语句的地方执行委托。
这样就可以实现传值!
具体的要看你是怎样的问题,不妨贴出来给我看一下
我写完给你!

关於委托我做了个例子:
两个窗口
窗口1:
上面有两个按钮和一个Textbox:一个按钮是执行委托!另一个按钮来了打
开窗口2;
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace delegate1
{
public delegate void Getstr(string txtBoxStr);
public partial class Form1 : Form
{

public Form1()
{
InitializeComponent();
}

private void btnform1_Click(object sender, EventArgs e)
{
Getstr gstr = new Getstr(Form2.GettxtBoxStr);

gstr(txtBox.Text);

}

private void btnForm2_Click(object