I have a stored procedure like this:
ALTER procedure [dbo].[fetchkey]
@carid nvarchar(50) =null
as
begin
select t.TBarcode, t.Status,[dbo].[keyloc](t.status,@carid) as 'keylocation'
from Transaction_tbl t
where t.TBarcode=@carid
end
Also i have function like this:
ALTER function [dbo].[keyloc](@status numeric(18,2),@cardID VARCHAR(50)) RETURNS varchar(50)
as
begin
@Ename nvarchar(50)
, @keylocation Varchar(50)
if @status=0
begin
select @keylocation= 0
end
return @keylocation
end
while executing my stored procedure i am getting out put like this:
TBarcode Status keylocation
53012364813 0 0
am filling this data to directly data grid view ,here my vb.net code
Dim cmd As New SqlCommand("fetchkey", con.connect)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@carid", SqlDbType.Int).Value = carid
da.SelectCommand = cmd
da.Fill(ds)
DGVDashBoard.DataSource = ds.Tables(0).
if i bind like this,in data grideviw i am getting 3 column.in data grid view i want to display only Tbarcode value and status value.also i want to show the particular data grid view row in red color becouse of the keylocation 0.how i can achieve this.if any one know how to do,please help me.