I have a table name dbo.tblPSData consisting numbers or records related to 6 different entity. What i do here i assign a Unique ID to these 6 different entity like...
101-For Schools
102-Transports
103-Hospitals
104-Functions
106-Security
these entity consisting no. of records and i used datagrid view to show total number of records enter in single entity on particular date...
CODE Service_Name Date Total_Records_Enter
101 Schools 14-03-2011 36
102 Transport 16-03-2011 126
103 Hospital 16-03-2011 76
104 Function 18-02-2011 23
106 Security 12-04-2011 46
Now what i want when i double click on any single row of datagrid view a new windows form loaded and it show me the total number of records enter on particular date show in gridview on entity.
UPDATE:
private string _id;
public string Id
{
get { return _id; }
set { _id = value; }
}
private DateTime dt;
public DateTime _dt
{
get { return dt; }
set{dt=value;}
}
private void DataShowForm_Load(object sender, EventArgs e)
{
string s;
SqlConnection con = new SqlConnection("data source=ASHU-PC;initial catalog=login;integrated Security=true");
SqlDataAdapter adp = new SqlDataAdapter("select * from tblPSData where code_id='" + _id + "' and SDate='"+_dt+"' order by serial_no", con);
DataSet ds = new DataSet();
adp.Fill(ds,"tm");(This line came with exception "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.")
dataGridView1.DataSource = ds.Tables["tm"];
}
what i have to do ???
HELP
THANKS