Hi Ian,
I am not a C# developer but there are a lot places in the web which will help you converting from one language to the other.
Here my previous VB code converted to C# from
http://www.developerfusion.com/tools/convert/vb-to-csharp/
public void FindDuplicateTransactionItem(int pFK_Items, string pCardLotNo, int pSerialNumber_Start, int pCardQty)
{
//-- Establish Locals
using (SqlCommand cmd = new SqlCommand()) {
//-- Build the command
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "dbo.spFindDuplicateCardItem";
//-- Create and set the parameters
cmd.Parameters.AddWithValue("@pFK_Items", pFK_Items).SqlDbType = SqlDbType.Int;
cmd.Parameters.AddWithValue("@pCardLotNo", pCardLotNo).SqlDbType = SqlDbType.VarChar;
cmd.Parameters.AddWithValue("@pStartSerialNumber", pSerialNumber_Start).SqlDbType = SqlDbType.Int;
cmd.Parameters.AddWithValue("@pCardQuantity", pCardQty).SqlDbType = SqlDbType.Int;
this.FillDataTable(cmd);
}
}
Now back to your problem, I believe what you want is just get the this.trkpdt.Text value based on the Trk_lic.Text value, if so, take a look in the help file on how to create an Scalar method in your BO that will return that trkpdt value.
What you are doing now is not going to work because you are clearing the PrimaryBusinessObject of the form which I assume is this.truckBO1 and then filling it with the data to get the Trk_lic.Text value. Spend some time with the SF help file which have pretty good examples of Scalar methods or search in the forums for more real examples. These are functionality that mostly every application will use and if you learn it well, then you can re-use whenever you need it.
Edhy Rijo