S
shapper
Hello,
I have the following code:
1 ' Code that creates the connection, parameters, etc
2 ' ...
3
4 ' Execute the command
5
6 ' ???? THE CODE I NEED TO KNOW
7
8 value.Close()
9 connection.Close()
Consider that I always get records with only one field named
"ContentHtml".
If there is only one record I want to get the value in ContentHtml
field.
If there is no records I want to define result = "NoRecords" and do
nothing else.
If there are more than one record I want to define result =
"MultipleRecords" and do nothing else.
My question is:
1. Should I do this in my MS SQL code?
2. How could I do this in my .NET code?
I could use a DataReader but I am not sure if this is the right
way:
Dim value As DbDataReader = command.ExecuteReader()
.... ???
As I said I need to determine if the number of records is 0, 1 or
more than 1.
Could somebody help me out?
Thanks,
Miguel
I have the following code:
1 ' Code that creates the connection, parameters, etc
2 ' ...
3
4 ' Execute the command
5
6 ' ???? THE CODE I NEED TO KNOW
7
8 value.Close()
9 connection.Close()
Consider that I always get records with only one field named
"ContentHtml".
If there is only one record I want to get the value in ContentHtml
field.
If there is no records I want to define result = "NoRecords" and do
nothing else.
If there are more than one record I want to define result =
"MultipleRecords" and do nothing else.
My question is:
1. Should I do this in my MS SQL code?
2. How could I do this in my .NET code?
I could use a DataReader but I am not sure if this is the right
way:
Dim value As DbDataReader = command.ExecuteReader()
.... ???
As I said I need to determine if the number of records is 0, 1 or
more than 1.
Could somebody help me out?
Thanks,
Miguel