Click here to Skip to main content
15,922,015 members
Home / Discussions / C#
   

C#

 
GeneralRe: assign number to variable name Pin
MasterSharp25-Oct-07 14:54
MasterSharp25-Oct-07 14:54 
GeneralRe: assign number to variable name Pin
ThomasBates26-Oct-07 9:51
ThomasBates26-Oct-07 9:51 
JokeRe: assign number to variable name Pin
codemunkeh25-Oct-07 12:37
codemunkeh25-Oct-07 12:37 
AnswerRe: assign number to variable name Pin
Anthony Mushrow25-Oct-07 13:10
professionalAnthony Mushrow25-Oct-07 13:10 
QuestionHow to Access Control on a From from different class Pin
A.Asif25-Oct-07 9:07
A.Asif25-Oct-07 9:07 
AnswerRe: How to Access Control on a From from different class Pin
Alain Normandin25-Oct-07 10:06
Alain Normandin25-Oct-07 10:06 
GeneralRe: How to Access Control on a From from different class Pin
A.Asif25-Oct-07 10:40
A.Asif25-Oct-07 10:40 
AnswerRe: How to Access Control on a From from different class Pin
Alain Normandin26-Oct-07 10:29
Alain Normandin26-Oct-07 10:29 
From what I see, you need to bind some data to your DataGridView. I dont have enough informations to give you a complete answer but I will give you some pointers.

First, to add some data to your DataGridView, you should use the databinding and let .NET do the job for you.

Using a second class to access the data is a good idea. You should check some design idea and best practice in multi-tier applications and separate your data access, business logic and rendering (presentation layer). You will see that a lot of the things that relate to data access on .NET application already exist in the framework and you dont need to reinvent the wheel.

A very partial example could look like this :

class class1
{
   internal DataGridView DataView1 = new DataGridView();

   public Rebind()
   {
      DataAccessor cls = new DataAccessor();
      DataView1.DataSource = cls.GetData();
      DataView1.DataBind();
   }

}

class DataAccessor
{
   public DataSet GetData()
   {
      DataSet data = // Access a database or other...;
      return data;
      
   }
}


See also



Hope that help.
AnswerRe: How to Access Control on a From from different class Pin
darkelv25-Oct-07 23:55
darkelv25-Oct-07 23:55 
QuestionHow to check for Operating System? Pin
Khoramdin25-Oct-07 8:47
Khoramdin25-Oct-07 8:47 
AnswerRe: How to check for Operating System? Pin
conemajstor25-Oct-07 9:30
conemajstor25-Oct-07 9:30 
QuestionString Format Help! Pin
solutionsville25-Oct-07 8:36
solutionsville25-Oct-07 8:36 
AnswerRe: String Format Help! Pin
pmarfleet25-Oct-07 9:20
pmarfleet25-Oct-07 9:20 
GeneralRe: String Format Help! Pin
solutionsville25-Oct-07 9:22
solutionsville25-Oct-07 9:22 
GeneralRe: String Format Help! Pin
pmarfleet25-Oct-07 9:32
pmarfleet25-Oct-07 9:32 
GeneralRe: String Format Help! Pin
solutionsville25-Oct-07 9:33
solutionsville25-Oct-07 9:33 
QuestionDataSet.DataTable.Select() returns undefined value Pin
Rukmini T25-Oct-07 8:32
Rukmini T25-Oct-07 8:32 
AnswerRe: DataSet.DataTable.Select() returns undefined value Pin
pmarfleet25-Oct-07 9:40
pmarfleet25-Oct-07 9:40 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
Rukmini T25-Oct-07 10:58
Rukmini T25-Oct-07 10:58 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
pmarfleet25-Oct-07 11:08
pmarfleet25-Oct-07 11:08 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
Rukmini T25-Oct-07 11:16
Rukmini T25-Oct-07 11:16 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
pmarfleet25-Oct-07 11:40
pmarfleet25-Oct-07 11:40 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
Paul Conrad23-Dec-07 15:02
professionalPaul Conrad23-Dec-07 15:02 
QuestionYUV player Pin
project c25-Oct-07 8:22
project c25-Oct-07 8:22 
QuestionDesign Patterns Pin
ilango gandhi25-Oct-07 7:30
ilango gandhi25-Oct-07 7:30 

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.