Hi All,
I encountered some problems, See details below:
how get date in c# dateTimePicker control,i need date only.such as:2011-10-15 (yyyy-month-day).
Can not immediately update the data in treeView1_NodeMouseClick event.
see code below:
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
dataGridView1.DataSource = "";
try
{
string AccessAddress = System.IO.Path.GetFullPath("PSRecord.mdb");
//con = new OleDbConnection(@"provider=microsoft.ace.oledb.12.0;persist securityInfo=false;data source=" + AccessAddress);
con = new OleDbConnection(@"provider=microsoft.jet.oledb.4.0;data source=" + AccessAddress);
con.Open();
cmd = new OleDbCommand("select * from Record where driver='" + treeView1.SelectedNode.Text.ToString() + "'", con);
ds = new DataSet();
adapter = new OleDbDataAdapter(cmd);
adapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();
}
}
i need help now,Thanks!
Kenny Tangnde
16-Oct-2011Hi Haider M Rizvi,
Thank you for reminding me, i will correct.
Thanks.
Anonymous User
15-Oct-2011Hi Aken H,
It is always a good habbit to ask someone if you get stuck some where, and I appretiate you do so to get your queries solved. But I have a suggestion for you so that you can get your answer more quickly.
Please do make sure that if you have more than one query always start a seperate thread for each problem so that each of your problem get noticed individually.
Hope, you got all your problems solved here and you will be following the the suggestions provided above in near future.
Thanks.
John Smith
15-Oct-2011Kenny Tangnde
15-Oct-2011x86 can run it in XP sp2 environment?
thanks!
Uttam Misra
15-Oct-2011To resolve this issue open the project in Visual Studio :
1. From the solution explorer right-click your project then click Properties
2. Click the Build tab
3. Change Platform target from: Any CPU to x86
4. Re-build your solution
Kenny Tangnde
15-Oct-2011Uttam Misra
15-Oct-2011Are you running your application on x64 or x86 version of Windows?
Kenny Tangnde
15-Oct-2011Uttam Misra
15-Oct-2011Kenny Tangnde
15-Oct-2011I have a problem,client run my program error occurred,Error content is:The 'microsoft.jet.oledb.4.0' provider is not registered on the local machine.
Code is as follows:
private void frmMain_Load(object sender, EventArgs e)
{
string AccessAddress=System.IO.Path.GetFullPath("PSRecord.mdb");
//con = new OleDbConnection(@"provider=microsoft.ace.oledb.12.0;persist securityInfo=false;data source=" + AccessAddress);
con = new OleDbConnection(@"provider=microsoft.jet.oledb.4.0;data source=" + AccessAddress);
con.Open();
cmd = new OleDbCommand("select drivername from driver", con);
reader = cmd.ExecuteReader();
TreeNode parent = treeView1.Nodes.Add("DriverName");
TreeNode child;
parent.ForeColor = Color.Red;
while (reader.Read())
{
//comboBox1.Items.Add(reader["DriverName"]);
child = parent.Nodes.Add(reader.GetValue(0).ToString());
child.ForeColor = Color.Blue;
}
parent.ExpandAll();
reader.Close();
con.Close();
}
thanks very much.
Kenny Tangnde
15-Oct-2011Hi Uttam Misra,
You help me to solve the first problem, the problem is now the second left.
thanks for your help.
Uttam Misra
14-Oct-2011Here you go...check this article... DateTimePicker Control in C#.Net