Click here to Skip to main content
15,927,055 members
Home / Discussions / C#
   

C#

 
GeneralOutlook Bar Problem Pin
BigBlob20227-Feb-04 12:49
BigBlob20227-Feb-04 12:49 
GeneralRe: Outlook Bar Problem Pin
Matthew Hazlett27-Feb-04 13:16
Matthew Hazlett27-Feb-04 13:16 
GeneralRe: Outlook Bar Problem Pin
BigBlob20227-Feb-04 13:24
BigBlob20227-Feb-04 13:24 
GeneralExpert only question...please help me Pin
aleang7227-Feb-04 12:34
aleang7227-Feb-04 12:34 
GeneralRe: Expert only question...please help me Pin
Heath Stewart28-Feb-04 3:59
protectorHeath Stewart28-Feb-04 3:59 
QuestionImpersonation??? Pin
Bill Dean27-Feb-04 12:33
Bill Dean27-Feb-04 12:33 
AnswerRe: Impersonation??? Pin
turbochimp27-Feb-04 17:08
turbochimp27-Feb-04 17:08 
GeneralDataTable problem! Pin
visiontec27-Feb-04 12:03
visiontec27-Feb-04 12:03 
Hi there

I have a problem in using a data table object created from a dataset object.

I have a form that has the following controls:
2 textboxs : txtTodayEvents , txtTodayDescr
1 listbox : lbToday
1 label : lblToday

The database i am using has the following fields:
ID
EventName
Description
EventDate

This is the code that i am using to get my data table working:
private void TodaysEvents()
{
   DataSet dsAllEvents = new DataSet("Events");
   dsAllEvents.ReadXml("EventsDB.xml");
   // i use an acess DB but this is to show
   // that i got the dataset filled.
   
   string date = DateTime.Now.ToShortDateString();
   int todEve = dsAllEvents.Tables["Events"].Select("EventDate Like '*" + date + "*'").Length; //works gr8 uptill here

   if(todEve>=1)
   {
      DataTable TodTable = new DataTable("TE");
      TodTable.Columns.Add("ID",System.Type.GetType("System.String"));
      TodTable.Columns.Add("EventName",System.Type.GetType("System.String"));
      TodTable.Columns.Add("Description");
      TodTable.Columns.Add("EventDate",System.Type.GetType("System.String"));
  
      TodTable.Rows.Add(dsAllEvents.Tables["Events"].Select("EventDate Like '*" + date + "*'"));

      lbToday.DataSource = TodTable;
      lbToday.DisplayMember = "EventDate";
      lbToday.Visible = true;

      txtTodayEvent.DataBindings.Add("Text",TodTable,"EventName");
      txtTodayEvent.Visible = true;

      txtTodayDescr.DataBindings.Add("Text",TodTable,"Description");
      txtTodayDescr.Visible = true;
   }
   else
   {
      lblToday.Visible = true;
   }
}


when i run this code it runs but i get nothing in my controls
Can anyone plz tell me what i am doing wrong?

VisionTec
GeneralRe: DataTable problem! Pin
turbochimp27-Feb-04 16:17
turbochimp27-Feb-04 16:17 
Questionhow to use an icon in multiple places Pin
visiontec27-Feb-04 11:43
visiontec27-Feb-04 11:43 
AnswerRe: how to use an icon in multiple places Pin
Heath Stewart28-Feb-04 3:46
protectorHeath Stewart28-Feb-04 3:46 
GeneralIcons Pin
BigBlob20227-Feb-04 10:18
BigBlob20227-Feb-04 10:18 
GeneralRe: Icons Pin
Heath Stewart27-Feb-04 11:27
protectorHeath Stewart27-Feb-04 11:27 
GeneralRe: Icons Pin
BigBlob20227-Feb-04 12:08
BigBlob20227-Feb-04 12:08 
GeneralRe: Icons Pin
Heath Stewart28-Feb-04 3:21
protectorHeath Stewart28-Feb-04 3:21 
Questionwhat is wrong with code?? Pin
SherKar27-Feb-04 10:14
SherKar27-Feb-04 10:14 
AnswerRe: what is wrong with code?? Pin
Heath Stewart27-Feb-04 11:15
protectorHeath Stewart27-Feb-04 11:15 
GeneralRe: what is wrong with code?? Pin
Dave Kreskowiak27-Feb-04 16:43
mveDave Kreskowiak27-Feb-04 16:43 
GeneralRe: what is wrong with code?? Pin
SherKar27-Feb-04 20:55
SherKar27-Feb-04 20:55 
GeneralRe: what is wrong with code?? Pin
Heath Stewart28-Feb-04 3:28
protectorHeath Stewart28-Feb-04 3:28 
GeneralRe: what is wrong with code?? Pin
SherKar27-Feb-04 20:58
SherKar27-Feb-04 20:58 
GeneralPorting to C# Pin
Kant27-Feb-04 9:30
Kant27-Feb-04 9:30 
GeneralRe: Porting to C# Pin
Heath Stewart27-Feb-04 9:49
protectorHeath Stewart27-Feb-04 9:49 
GeneralRe: Porting to C# Pin
Kant27-Feb-04 10:31
Kant27-Feb-04 10:31 
GeneralRe: Porting to C# Pin
Heath Stewart27-Feb-04 11:08
protectorHeath Stewart27-Feb-04 11:08 

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.