# Asp.net+C# | A weird problem with a variable

**URL:** <https://forum.kirupa.com/t/asp-net-c-a-weird-problem-with-a-variable/301580>\
**Category:** Uncategorized\
**Created:** [December 11, 2009, 4:06pm UTC](https://forum.kirupa.com/t/asp-net-c-a-weird-problem-with-a-variable/301580 "2009-12-11T16:06:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corpes](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@Corpes](https://forum.kirupa.com/u/Corpes)\
**Post date:** [December 11, 2009, 4:06pm UTC](https://forum.kirupa.com/t/asp-net-c-a-weird-problem-with-a-variable/301580/1 "2009-12-11T16:06:04Z")

</div>

Regards,

I have a weird problem with a variable in [asp.net](http://asp.net) + C#.

Those lines works:

```php

DataTable customer = service.GetCustomerDT(1);
dataRow["CustomerName"] = customerDT.Rows[0]["FullName"];

```

But those lines does not found anything even though the value of the variable is “1” too:

```php

int customerID = int.Parse(gridViewRowVar.Cells[0].Text.ToString());
DataTable customerDT = service.GetCustomerDT(customerID);
dataRow["CustomerName"] = customerDT.Rows[0]["FullName"];

```

The big surprise, as I said before, is that:  
I know that the value of the varible is also 1, and to check it I tried:

```auto
[SIZE=2]
Response.Redirect(customerID.Equals(1).ToString());
[/SIZE]

```

It does return True.

But somehow the previous lines doesn’t work.

Thanks to my experience I think it’s essential “clean” the varible before using it,  
but I don’t know how to do this. In asp I think I have used something like: “Clng”.

Did u understand me?  
Could u help me plz?  
Thanks!
