Click here to Skip to main content
15,917,329 members
Home / Discussions / C#
   

C#

 
GeneralRe: api documentation Pin
Nick Parker13-Mar-04 10:51
protectorNick Parker13-Mar-04 10:51 
GeneralRe: api documentation Pin
Prakash Nadar14-Mar-04 1:12
Prakash Nadar14-Mar-04 1:12 
Questionhow to change datalist's bind fied by codebehind code? Pin
BigGirlBigEyes12-Mar-04 17:04
BigGirlBigEyes12-Mar-04 17:04 
GeneralDataGrid to DataSet to XML Pin
jazzle12-Mar-04 16:04
jazzle12-Mar-04 16:04 
GeneralRe: DataGrid to DataSet to XML Pin
Mike Ellison12-Mar-04 19:07
Mike Ellison12-Mar-04 19:07 
GeneralRe: DataGrid to DataSet to XML Pin
jazzle13-Mar-04 0:53
jazzle13-Mar-04 0:53 
GeneralRe: DataGrid to DataSet to XML Pin
OmegaSupreme13-Mar-04 2:30
OmegaSupreme13-Mar-04 2:30 
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 

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.