M
Michael Jones
Ok.......... I'm trying to fill a parameterized table onto a Dataset
via a sqlDataAdapter. It works fine if I fill the Dataset with all
the column fields. What I want to do though is to only fill the
Dataset with certain values from my DateTimeIn column (i.e. only files
where DateTimeIn == user-defined date). This isn't working.
I'm sure my query is correct because I've used the same code in
different projects:
SELECT TransIdentity, DateTimeIn, DateTimeOut, RevisedDate FROM
TransactionData WHERE (DateTimeIn = @Param2)
What I think it is is that the user-inputed date is not being read
right as a parameter. Does it matter that the txtDateParameter.Text
is not in DateTime format? I don't think so.
private void btnShow_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.SelectCommand.Parameters["DateTimeIn"].Value =
txtDateParameter.Text;
dsTimeIn1.Clear();
sqlDataAdapter1.Fill(dsTimeIn1);
}
Can someone help me out, I can't figure out what's going on.
Let me know if you need some more info.
Thanks guys,
Frustrated Mike
via a sqlDataAdapter. It works fine if I fill the Dataset with all
the column fields. What I want to do though is to only fill the
Dataset with certain values from my DateTimeIn column (i.e. only files
where DateTimeIn == user-defined date). This isn't working.
I'm sure my query is correct because I've used the same code in
different projects:
SELECT TransIdentity, DateTimeIn, DateTimeOut, RevisedDate FROM
TransactionData WHERE (DateTimeIn = @Param2)
What I think it is is that the user-inputed date is not being read
right as a parameter. Does it matter that the txtDateParameter.Text
is not in DateTime format? I don't think so.
private void btnShow_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.SelectCommand.Parameters["DateTimeIn"].Value =
txtDateParameter.Text;
dsTimeIn1.Clear();
sqlDataAdapter1.Fill(dsTimeIn1);
}
Can someone help me out, I can't figure out what's going on.
Let me know if you need some more info.
Thanks guys,
Frustrated Mike