Showing posts with label return. Show all posts
Showing posts with label return. Show all posts

Friday, March 30, 2012

Putting SqlDataSource code in code-behind

Hi,

I need some help here. I have a SELECT sql statement that will query the table. How do I get the return value from the sql statement to be assigned to a label. Any article talk about this?

Thanks geniuses.

This link:

http://aspnet.4guysfromrolla.com/articles/022206-1.aspx

|||

Hi ahTan,

You may need to use a SqlDataAdapter to fill the result set into a DataSet. Here is an example.

SqlConnection cnn = new SqlConnection("your connection string here");
SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Table1", cnn);
DataSet ds = new DataSet();
sda.Fill(ds);

sql

Saturday, February 25, 2012

Publish custom assembly with query

My custom assembly works in design mode but when i publish it :

- function without query work well.

- function with query return an error (#Error).

The assembly was copied in C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin

What can i do the use query in my custom assembly.

Thanks for all your answers.

Have you looked at this article.

http://support.microsoft.com/default.aspx?scid=kb;en-us;842419

Problems with custom assemblies are usually related to not granting the correct permissions to the assembly in the config files.