Monday, March 19, 2012
Creating a Report Model - any doc other than Books Online?
the SQL Books Online? The subject is usually given about 3-5 pages max in
any Reporting Services book. I'd like to see a whole book on the subject,
with lots of examples.
--
LehrSJOn Sep 12, 6:18 pm, LehrSJ <lehr...@.noemail.nospam> wrote:
> Is there any documentation available on building a report model other than
> the SQL Books Online? The subject is usually given about 3-5 pages max in
> any Reporting Services book. I'd like to see a whole book on the subject,
> with lots of examples.
> --
> LehrSJ
This link might be helpful.
http://www.databasejournal.com/features/mssql/article.php/10894_3598931_1
Regards,
Enrique Martinez
Sr. Software Consultant
Wednesday, March 7, 2012
Creating a dataset
Im trying to complete my function which will allow me to insert data into a table by referencing it in the relevant pages, the following code is what i am using to take the SQL query, execute it and return the resultant dataset in destResponse. However i am getting the following error message; "Compiler Error Message:CS1026: ) expected". And it is coming from the following line;
SqlCommand command =newSqlCommand("INSERT INTO" + strTableName + strData +") VALUES (" + strData +")";
Here is my code below, please feel free to criticise it, and im sure the error above is not the only error i will be getting.
publicstaticvoid SQLExecute(string strTableName,string strData)
{
DataSet dsetResponse =newDataSet();// create connection object
strConnection =ConfigurationManager.AppSettings["strConnectionString"];SqlConnection conn =newSqlConnection(strConnection);
SqlCommand command =newSqlCommand("INSERT INTO" + strTableName + strData +") VALUES (" + strData +")";command.Fill(dsetResponse,"table");conn.Close();
return dsetResponse;}
("INSERT INTO" + strTableName + strData +" VALUES " + strData);
|||let me know if it is ok
|||your line should be like below
SqlCommand command =newSqlCommand("INSERT INTO " + strTableName + strData +") VALUES (" + strData +")");
|||
Missing a space after INTO.
Missing a closing parenthesis before the first semi-colon.
Missing a literal space and opening parenthesis between the strTableName and strData -- should be strTableName + ' (' + strData.
Used strData for both the column name list AND the column values.
SqlCommand command =new SqlCommand("INSERT INTO " + strTableName +" (" + strColumnList +") VALUES (" + strData +")"); |||
Hi thanks for responding, the one that worked was Motleys suggestion, however my next task is to return the results in a dataset; this is my code so far, am i on the right track?
publicstaticvoid SQLExecute(string strTableName,string strData){
String strConnection =null;
try
{
DataSet dsetResponse =newDataSet();// create connection object
strConnection =ConfigurationManager.AppSettings["strConnectionString"];SqlConnection conn =newSqlConnection(strConnection);
SqlCommand command =newSqlCommand("INSERT INTO " + strTableName +" (" + strData +") VALUES (" + strData +")");command.Fill(dsetResponse,"table");conn.Close();
return dsetResponse;}
}