Quantcast
Channel: Displaying only active records
Viewing all articles
Browse latest Browse all 16

Re: Displaying only active records

$
0
0

Can you explain exactly what you are trying to do? I notice there are quite a few things going on that may / may not be relevant :

stabes

protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e)

Using the OnRowCommand generally implies there is a button or "command" related with the specific row and clicking this will call this particular method. Is that what you are expecting to occur?

It appears so as you are grabbing a specific User ID but you don't currently seem to be using it :

stabes

Guid userId = Guid.Parse(e.CommandArgument.ToString());

Besides that your command itself looks fine and should store the proper value within your NumberOfRecords variable. Have you tried using the debugger to see what your NumberOrRecords looks like after this is executed or tried directly outputting it :

TextBox1.Text = Convert.ToString((Int32)myCommand.ExecuteScalar());

You might want to use something like SQL Server Management Studio (or Visual Studio) to actually go into your database and ensure that the specific IsApproved property exists and that you are targeting the proper table.


Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>