how to remove space in grid control

Posted by Anithap under ASP.NET on 8/29/2012 | Points: 10 | Views : 791 | Status : [Member] | Replies : 1
my storedprocedure is here

ALTER proc [dbo].[demo3]
@tblname varchar(max),
@clname varchar(max)
as
begin
declare @sql varchar(max)
set @sql='SELECT '+@clname+ ' from '+@tblname
exec(@sql)
print @clname
end


my .net coding is this

Dim ds As New DataSet()
cmd.Connection = con
cmd.CommandText = "demo3"
cmd.CommandType = CommandType.StoredProcedure
While (i < Session("count"))
cmd.Parameters.Clear()
cmd.Parameters.AddWithValue("@tblname", Session("a"))
cmd.Parameters.AddWithValue("@clname", ListBox3.Items(i).Text)
con.Open()
Dim da = New SqlDataAdapter(cmd)
da.Fill(ds)
con.Close()
gridview1.datasource=ds
gridview1.databind
i=i+1
end while



Output:

subject mark

English
Maths
80
90




Responses

Posted by: Sgtammana on: 9/7/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Can you please elaborate the Question. I didn't Understand it.

Anithap, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response