Sunday, November 27, 2011

A little of C# and SQL

This are two simple functions that reads and works with information obtained of a SQL Command "select"


The first function gets one parameter like a Primary Key and with a SQLReader object and SQLCommand, the function returns true o false, depends of the SQL Sentence has or not rows. If the SQL Sentense has rows, the function returns false, if the SQL Sentence hasn't rows, the function returns true
The following function make a similar work.
This recieve a parameter and execute a SQL Sentence (with the parameter received) and the rows obtained are saved in a SQL Data Reader object. Then, all field are collected in a string, separated by a '¿'.

The goal of this is have a easy way to work and manipulate the data obtained of a SQL Sentence

No comments:

Post a Comment

Mis Fotos