c# - Date value obtained from Masked Textbox and Date from Excel -
I'm trying to compare got on a Maskkedtekstboks who is accepting a little on, Axel With a date from the sheet. I have those lines will select the Excel file that equals date Masked textbox and display them in Detagrid scene. The problem is that I do not get a result and not an error of the compiled code is my code:
private void button 13_Click (object sender, EventArgs e) {OleDbConnection conn = new OleDbConnection (); Conn.ConnectionString = @ "Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C: \ Users \ alekan \ Desktop \ alm2.xlsx" + @ "; Extended Properties =" "Excel 12.0 XML; HDR = Yes; Ayatmicst Type = text; TypeGuessRows = 0 "" "; OleDbCommand command = new OleDbCommand ( "SELECT txt" + "" + FROM [sheet2 $] WHERE Acacmm = '+ Masked textbox 1. Text + "'", con); dataset dstxt = new DataSet (); OleDbDataAdapter adapter = new OleDbDataAdapter (command); adapter.Fill (dstxt); DataGridView1.DataSource = dstxt.Tables [0];}
PS. Txt and Acacmm has the column name.
Any help is extremely frustrating !!!!!
Comments
Post a Comment