Is it possible to combine two columns in DataView?

  • Thread starter Thread starter Stan
  • Start date Start date
S

Stan

Hi,

My stored procedure returns FirstName and LastName fields.

I want to bind a DropDownList to the results of this stored procedure and
combine two those fields.

Although it would be very easy to make a database view (SELECT FirstName + '
' + LastName ....) I don't want to do that.

Is it possible to execute the stored procedure tha I have, fill DataTabe and
than build a DataView which combines columns?

Thanks,

-Stan
 
Add a calculated column.

myDataSEt.Tables[0].Columns.Add["MyColumn", typeof(string));
myDataSet.Tables[0].Columns["MyColumn"].Expressions = "FirstName + " " +
LastNa me)";
 
I got the idea. Actually expression should be "FirstName + ' ' + LastName"..

It sounds that I don't even need a view...

Thanks!

William Ryan said:
Add a calculated column.

myDataSEt.Tables[0].Columns.Add["MyColumn", typeof(string));
myDataSet.Tables[0].Columns["MyColumn"].Expressions = "FirstName + " " +
LastNa me)";
Stan said:
Hi,

My stored procedure returns FirstName and LastName fields.

I want to bind a DropDownList to the results of this stored procedure and
combine two those fields.

Although it would be very easy to make a database view (SELECT FirstName
+
'
' + LastName ....) I don't want to do that.

Is it possible to execute the stored procedure tha I have, fill DataTabe and
than build a DataView which combines columns?

Thanks,

-Stan
 
Back
Top