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

C#

 
GeneralRe: query dataset Pin
Paul Brower22-Jun-05 3:46
Paul Brower22-Jun-05 3:46 
GeneralRe: query dataset Pin
david cohoon22-Jun-05 7:55
david cohoon22-Jun-05 7:55 
GeneralRe: query dataset Pin
Anonymous22-Jun-05 8:08
Anonymous22-Jun-05 8:08 
GeneralC# MDI parent form & mdi form childs questions...urgent help please! Pin
GianlucaSeno22-Jun-05 0:49
GianlucaSeno22-Jun-05 0:49 
GeneralRe: C# MDI parent form & mdi form childs questions...urgent help please! Pin
sreejith ss nair22-Jun-05 2:57
sreejith ss nair22-Jun-05 2:57 
GeneralRe: C# MDI parent form & mdi form childs questions...urgent help please! Pin
GianlucaSeno22-Jun-05 3:42
GianlucaSeno22-Jun-05 3:42 
GeneralRe: C# MDI parent form & mdi form childs questions...urgent help please! Pin
david cohoon22-Jun-05 7:19
david cohoon22-Jun-05 7:19 
GeneralRe: C# MDI parent form & mdi form childs questions...urgent help please! Pin
GianlucaSeno22-Jun-05 7:42
GianlucaSeno22-Jun-05 7:42 
Thanks for your answer...for the first question I try and it works great! Big Grin | :-D
<b>And with the same method...I can close FORM2 from FORM1?</b>

For the second question, that's very important for me...could you give me an example how to solve this problem?I dont have so much experience with C# language to solve it... Big Grin | :-D
Someone told me that for solve this problem I've to create a static method in FORM2 and then I can call it from FORM2 but I try but it there is an error...
the code is...

public class FORM2 : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
private System.Windows.Forms.DataGrid dataPreResult;

public FORM2()
{
InitializeComponent();
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataPreResult = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.dataPreResult)).BeginInit();
this.SuspendLayout();
//
// dataPreResult
//
this.dataPreResult.AllowSorting = false;
this.dataPreResult.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dataPreResult.DataMember = "";
this.dataPreResult.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataPreResult.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.dataPreResult.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataPreResult.Location = new System.Drawing.Point(0, 0);
this.dataPreResult.Name = "dataPreResult";
this.dataPreResult.ReadOnly = true;
this.dataPreResult.RowHeaderWidth = 10;
this.dataPreResult.Size = new System.Drawing.Size(232, 613);
this.dataPreResult.TabIndex = 0;
//
// FORM2
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(232, 613);
this.Controls.Add(this.dataPreResult);
this.Location = new System.Drawing.Point(600, 10);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FORM2";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Load += new System.EventHandler(this.StringPreResult_Load);
((System.ComponentModel.ISupportInitialize)(this.dataPreResult)).EndInit();
this.ResumeLayout(false);
}
#endregion

public void StringPreResult_Load(object sender, System.EventArgs e)
{
ReadResults();
}

public static void ReadResults()
{
OleDbDataAdapter da = new OleDbDataAdapter();
OleDbConnection con =new OleDbConnection();
OleDbCommand cmd = new OleDbCommand();
DataTable dt =new DataTable();
dt.Clear();
con.ConnectionString=<connectionstring>;
con.Open();
cmd.Connection = con;
cmd.CommandText = "SELECT * FROM TABLE";

da.SelectCommand = cmd;
da.Fill(dt);

dataPreResult.SetDataBinding(dt,"");

cmd.Cancel();
con.Close();
}
}


I run code and this is the error:
<u><b>'FORM2.dataPreResult' denotes a 'field' where a 'class' was expected</b></u>

I'm so confused...what I've to do?Confused | :confused:

GeneralRe: C# MDI parent form &amp; mdi form childs questions...urgent help please! Pin
Anonymous22-Jun-05 11:18
Anonymous22-Jun-05 11:18 
GeneralPOS system Pin
Carl-Johan Larsson21-Jun-05 23:19
Carl-Johan Larsson21-Jun-05 23:19 
Generalcustom treeview structure Pin
deep721-Jun-05 23:16
deep721-Jun-05 23:16 
GeneralRe: custom treeview structure Pin
Dave Kreskowiak22-Jun-05 5:46
mveDave Kreskowiak22-Jun-05 5:46 
GeneralManipulate Windows Explorer folder properties dialog Pin
Ligblou21-Jun-05 23:03
Ligblou21-Jun-05 23:03 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Ligblou22-Jun-05 3:42
Ligblou22-Jun-05 3:42 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Dave Kreskowiak22-Jun-05 5:33
mveDave Kreskowiak22-Jun-05 5:33 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Ligblou22-Jun-05 22:11
Ligblou22-Jun-05 22:11 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Dave Kreskowiak22-Jun-05 5:28
mveDave Kreskowiak22-Jun-05 5:28 
GeneralRe: Manipulate Windows Explorer folder properties dialog Pin
Ligblou22-Jun-05 22:14
Ligblou22-Jun-05 22:14 
GeneralRichTextbox Problem Pin
heavenamour21-Jun-05 22:35
heavenamour21-Jun-05 22:35 
Generalsimple question or not Pin
raf9521-Jun-05 22:29
raf9521-Jun-05 22:29 
GeneralRe: simple question or not Pin
Sebastian Schneider21-Jun-05 23:21
Sebastian Schneider21-Jun-05 23:21 
GeneralC # chat Application Pin
idreesbadshah21-Jun-05 22:00
idreesbadshah21-Jun-05 22:00 
GeneralAdding handler to event without knowing it's name Pin
Piotrus21-Jun-05 21:57
Piotrus21-Jun-05 21:57 
GeneralRe: Adding handler to event without knowing it's name Pin
mav.northwind22-Jun-05 2:26
mav.northwind22-Jun-05 2:26 
GeneralReading &#229;, &#228;, &#246; from file with StreamReader Pin
anderslundsgard21-Jun-05 20:52
anderslundsgard21-Jun-05 20:52 

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.