07-04-2006, 15:23
|
|
|
חבר מתאריך: 09.10.02
הודעות: 19
|
|
לא יודע מה זה AutoPostBack, אבל אתן דוגמא לבעיה
קוד:
public partial class _Default : System.Web.UI.Page
{
DataSet1 ds;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ds = new DataSet1();
DataRow dr = ds.Tables[0].NewRow();
dr["name"] = "hi!!!";
ds.Tables[0].Rows.Add(dr);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = ds.Tables[0].Rows[0][1].ToString();
}
}
בפונקציה של הכפתור זה עושה שגיאה שds הוא null
השגיאה: Object reference not set to an instance of an object.
למישהו יש פיתרון?
נערך לאחרונה ע"י Arye_kalter בתאריך 07-04-2006 בשעה 15:29.
|