Convert varchar value to tinyint?

0

I have a value in a textbox (varchar) in a webform of asp .net and I need to compare it with a tinyint type value of sql.

What would be the way?

Thanks

Greetings

    
asked by sunflower 08.03.2018 в 17:29
source

1 answer

1

I recommend you read this article.

link

There you can see the data relationship between the different SQL and C # data types

In your case, to be able to insert tinyint you must use Byte

string a = "1";
Byte b;

b = Convert.ToByte(a);

Byte c = 0;

if(b>c){
.......
}

I hope it serves you .. Greetings

    
answered by 09.03.2018 / 13:10
source