Click here to Skip to main content
15,902,276 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGrid to DataSet to XML Pin
jazzle13-Mar-04 3:30
jazzle13-Mar-04 3:30 
GeneralRe: DataGrid to DataSet to XML Pin
Mike Ellison15-Mar-04 8:29
Mike Ellison15-Mar-04 8:29 
Generalhelp!!! Very strange problem with sending mail Pin
wolft12-Mar-04 15:17
wolft12-Mar-04 15:17 
GeneralRe: help!!! Very strange problem with sending mail Pin
John Fisher13-Mar-04 13:30
John Fisher13-Mar-04 13:30 
GeneralINT to Binary Pin
MrEyes12-Mar-04 14:14
MrEyes12-Mar-04 14:14 
GeneralRe: INT to Binary Pin
PJL12-Mar-04 15:04
PJL12-Mar-04 15:04 
GeneralRe: INT to Binary Pin
Michael Flanakin17-Mar-04 19:36
Michael Flanakin17-Mar-04 19:36 
GeneralSomething wrong with my binding to datagird. Pin
lordjpg12-Mar-04 13:08
lordjpg12-Mar-04 13:08 
Hey guys(first datagrid app and form app, be nice :p ), I am trying to bind a datatable to a datasource to a Datagrid and its not working...Im really confused. This is the compiler error I keep getting.


MyFormProject.MainForm.DataSource denotes a 'field' where a 'class' was expected.
-and-
MyFormProject.MainForm.DataGrid denotes a 'field' where a 'class' was expected.


the error line for 1st one is : ds.Tables.Add(dt);
the error line for 2nd one is : dg.SetDataBinding(ds,"Items");

ds is declared: private System.Data.DataSet ds;
dg is declared: private System.Windows.Forms.DataGrid dg;


Where this occurs:

public static void createset(database obj){

System.Data.DataTable dt = new DataTable("Items");

DataRow dr;
DataColumn dc;
int rowcount = obj.size;

System.Type typeint;
typeint = System.Type.GetType("System.Int32");

System.Type typestring;
typestring = System.Type.GetType("System.Int32");

dc = new DataColumn();

dc = new DataColumn("ID",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Name",typestring);
dt.Columns.Add(dc);
dc = new DataColumn("Type",typestring);
dt.Columns.Add(dc);
dc = new DataColumn("Buy Price",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Sell Price",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Weight",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Attack",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Defense",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Range",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Slot",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Gender",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Loc",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Weapon Level",typeint);
dt.Columns.Add(dc);
dc = new DataColumn("Player Level",typeint);
dt.Columns.Add(dc);

ds.Tables.Add(dt);

for(int i=0;i
GeneralRe: Something wrong with my binding to datagird. Pin
MrEyes12-Mar-04 14:30
MrEyes12-Mar-04 14:30 
GeneralRe: Something wrong with my binding to datagird. Pin
lordjpg12-Mar-04 15:30
lordjpg12-Mar-04 15:30 
GeneralAdding an Interface to my user controls Pin
TriBoy12-Mar-04 11:05
TriBoy12-Mar-04 11:05 
GeneralRe: Adding an Interface to my user controls Pin
John Fisher12-Mar-04 11:31
John Fisher12-Mar-04 11:31 
GeneralRemoting - instantiating a wellknown type Pin
Judah Gabriel Himango12-Mar-04 9:16
sponsorJudah Gabriel Himango12-Mar-04 9:16 
GeneralRe: Remoting - instantiating a wellknown type Pin
Heath Stewart12-Mar-04 10:29
protectorHeath Stewart12-Mar-04 10:29 
GeneralRe: Remoting - instantiating a wellknown type Pin
Judah Gabriel Himango12-Mar-04 11:03
sponsorJudah Gabriel Himango12-Mar-04 11:03 
GeneralRe: Remoting - instantiating a wellknown type Pin
Heath Stewart12-Mar-04 15:42
protectorHeath Stewart12-Mar-04 15:42 
QuestionIs there actually a difference (speed gain etc) ? Pin
Andres Coder12-Mar-04 8:05
Andres Coder12-Mar-04 8:05 
AnswerRe: Is there actually a difference (speed gain etc) ? Pin
Jeff Varszegi12-Mar-04 8:29
professionalJeff Varszegi12-Mar-04 8:29 
AnswerRe: Is there actually a difference (speed gain etc) ? Pin
HAHAHA_NEXT12-Mar-04 10:08
HAHAHA_NEXT12-Mar-04 10:08 
AnswerRe: Is there actually a difference (speed gain etc) ? Pin
Adrian Stanley13-Mar-04 0:31
Adrian Stanley13-Mar-04 0:31 
GeneralTextBox Access Pin
jmandile12-Mar-04 7:57
sussjmandile12-Mar-04 7:57 
GeneralRe: TextBox Access Pin
Dave Kreskowiak12-Mar-04 10:21
mveDave Kreskowiak12-Mar-04 10:21 
GeneralI want to write a application like Microsoft's PowerPoint User interface... Pin
aoyee12-Mar-04 6:49
aoyee12-Mar-04 6:49 
GeneralRe: I want to write a application like Microsoft's PowerPoint User interface... Pin
Mazdak12-Mar-04 7:18
Mazdak12-Mar-04 7:18 
GeneralRe: I want to write a application like Microsoft's PowerPoint User interface... Pin
aoyee12-Mar-04 8:40
aoyee12-Mar-04 8:40 

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.