using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public DataTable Categories;
public DataTable Subcategories;
public DataColumn col1;
public DataColumn col2;
public DataColumn col3;
public DataColumn col4;
public DataColumn col5;
public DataSet Datacollection;
public Form1()
{
InitializeComponent();
Datacollection = new DataSet("Alledata");
Categories = new DataTable();
Categories.TableName = "Categories";
Datacollection.Tables.Add(Categories);
//Column 1
col1 = Categories.Columns.Add();
col1.AllowDBNull = true;
col1.MaxLength = 5;
col1.ColumnName = "ID";
//---------------------
//Column 2
col2 = Categories.Columns.Add();
col2.AllowDBNull = true;
col2.MaxLength = 20;
col2.ColumnName = "Name";
//---------------------
//Column 3
col3 = Categories.Columns.Add();
col3.AllowDBNull = true;
col3.MaxLength = 100;
col3.ColumnName = "Description";
//---------------------
//Column 4
col4 = Categories.Columns.Add();
col4.AllowDBNull = true;
col4.MaxLength = 20;
col4.ColumnName = "Owner";
//---------------------
dataGridView1.DataSource = Categories;
}
}
}
This works for me. But if i compile the game, run it it doesn't save data if you enter. How can i save the data?











