Click here to Skip to main content
16,006,824 members
Home / Discussions / C#
   

C#

 
GeneralWSE 2.0 sp 1 problem Pin
sandu200428-Sep-04 22:35
sandu200428-Sep-04 22:35 
GeneralNO ONE KNOW THAT ??? what is the value ANY ONE REPLY ME PLZ Pin
MoustafaS28-Sep-04 22:26
MoustafaS28-Sep-04 22:26 
GeneralRe: NO ONE KNOW THAT ??? what is the value ANY ONE REPLY ME PLZ Pin
Stefan Troschuetz28-Sep-04 22:56
Stefan Troschuetz28-Sep-04 22:56 
GeneralRe: NO ONE KNOW THAT ??? what is the value ANY ONE REPLY ME PLZ Pin
benjymous29-Sep-04 2:27
benjymous29-Sep-04 2:27 
GeneralRe: NO ONE KNOW THAT ??? what is the value ANY ONE REPLY ME PLZ Pin
Nick Parker29-Sep-04 4:06
protectorNick Parker29-Sep-04 4:06 
GeneralRegistry and Eventlog!!! Pin
Member 140072028-Sep-04 21:38
Member 140072028-Sep-04 21:38 
GeneralRe: Registry and Eventlog!!! Pin
Rein Hillmann28-Sep-04 21:47
Rein Hillmann28-Sep-04 21:47 
GeneralI realy need help Pin
Sakkijha28-Sep-04 21:18
Sakkijha28-Sep-04 21:18 
hi
i have the folloeing code . it always give me this error :
ERROR: Object reference not set to an instance of an object.

here is the code:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace Final
{
///
/// Summary description for Form1.
///

public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.DataGrid dataGrid1;
private DataSet DS;
///
/// Required designer variable.
///

private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(80, 88);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(216, 88);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(56, 152);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(304, 152);
this.dataGrid1.TabIndex = 2;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(400, 350);
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void Form1_Load(object sender, System.EventArgs e)
{
addRC();
}

private void addRC()
{
DataTable test = new DataTable();
test.Columns.Add("students");
DataSet addRCDataSet = new DataSet("addRCDataSet");
addRCDataSet.Tables.Add(test);
dataGrid1.DataSource=addRCDataSet;
this.DS= addRCDataSet.Clone();
}

private void button1_Click(object sender, System.EventArgs e)
{
DataTable Dtable = DS.Tables["test"].Copy();
DataRow Dtr=Dtable.NewRow();
Dtr["students"]=textBox1.ToString();
Dtable.Rows.Add(Dtr);
DS.Tables.Remove("test");
DS.Tables.Add(Dtable);
}
}
}






can any 1 solve this problem 4 me ?
GeneralRe: I realy need help Pin
Rein Hillmann28-Sep-04 21:27
Rein Hillmann28-Sep-04 21:27 
GeneralRe: I realy need help Pin
Sakkijha28-Sep-04 21:44
Sakkijha28-Sep-04 21:44 
GeneralRe: I realy need help Pin
Rein Hillmann28-Sep-04 22:00
Rein Hillmann28-Sep-04 22:00 
GeneralRe: I realy need help Pin
Stefan Troschuetz28-Sep-04 21:30
Stefan Troschuetz28-Sep-04 21:30 
GeneralRe: I realy need help Pin
Sakkijha28-Sep-04 21:51
Sakkijha28-Sep-04 21:51 
GeneralChanging standard look of scroll bars Pin
Vladimir Knezevic28-Sep-04 21:08
Vladimir Knezevic28-Sep-04 21:08 
GeneralRe: Changing standard look of scroll bars Pin
RichiLloyd5-Oct-04 0:43
RichiLloyd5-Oct-04 0:43 
Generala FUNCTION 2 CALCULATE SECONDS since time struck 12 Pin
compu2rbloo28-Sep-04 18:50
compu2rbloo28-Sep-04 18:50 
GeneralRe: a FUNCTION 2 CALCULATE SECONDS since time struck 12 Pin
Rein Hillmann28-Sep-04 21:15
Rein Hillmann28-Sep-04 21:15 
GeneralRe: a FUNCTION 2 CALCULATE SECONDS since time struck 12 Pin
Stefan Troschuetz28-Sep-04 21:21
Stefan Troschuetz28-Sep-04 21:21 
GeneralRe: a FUNCTION 2 CALCULATE SECONDS since time struck 12 Pin
compu2rbloo29-Sep-04 18:55
compu2rbloo29-Sep-04 18:55 
GeneralRe: a FUNCTION 2 CALCULATE SECONDS since time struck 12 Pin
Gavin Jeffrey29-Sep-04 20:32
Gavin Jeffrey29-Sep-04 20:32 
Generalpdf text manipulation Pin
Naga Sudha28-Sep-04 18:43
Naga Sudha28-Sep-04 18:43 
GeneralRe: pdf text manipulation Pin
Heath Stewart29-Sep-04 6:01
protectorHeath Stewart29-Sep-04 6:01 
GeneralRe: pdf text manipulation Pin
Jon G29-Sep-04 6:12
Jon G29-Sep-04 6:12 
GeneralE-Commerce Pin
The_Soul_Of_Rock28-Sep-04 17:29
The_Soul_Of_Rock28-Sep-04 17:29 
GeneralRe: E-Commerce Pin
Werdna29-Sep-04 2:47
Werdna29-Sep-04 2:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.