Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Thursday, March 29, 2012

Get Analysis Services Version string in c#.net 2.0

Hi

I want to get the version string for AS 2000 and 2005 in c#. Can I use the same object model to connect to both or do I need one for each. I saw a reference to DSO 8.5 which implied you could.

Either way could you let me know what DDL I should reference in Visual Studio.

Thanks

Steve

If you are using Microsoft.AnalysisServices.AdomdClient then you can use AdomdConnection.ServerVersion property to obtain textual representation of the version. If you use System.Runtime.InteropServices.Version object then you can construct one to parse such things like major and minor numbers.

It works for AS2005 and AS2000.|||Works a treat Andrew thanks

Tuesday, March 27, 2012

Get @@rowcount data from MSSQL using SqlDataSource with delete command

Hi

I'm using a simple SqlDataSource to connect to a stored proc to delete a number of rows from different tables.

In my SQL im using:

DECLARE @.table1CountintDELETE FROM Table1WHERE id = @.new_idSET @.table1Count=@.@.rowcountSELECT @.table1Count

I'm then using an input box and linking it to the delete control parameter. Then on a button click event i'm running SqlDataSource1.Delete() which all works fine. But how do i get the @.table1Count back into my aspx page?

Thanks

use OUT parameter

CREATE PROC dbo.SP_DeleteID(@.new_id int, @.effRowCnt intOUT)

As

begin

DELETE FROM Table1WHERE id = @.new_id

SET @.effRowCnt=@.@.rowcount

end

|||

ok, but how do i reference the @.effRowCnt in the code behind page?

thanks

|||

If you are just trying to get a count of the number of rows deleted, an easier way to do it is to use the Deleted methodof the DataSource, something like:

ProtectedSub SQLDataSource1_Deleted(ByVal senderAsObject,ByVal eAs System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)Handles SQLDataSource1.Deleted

NumberofRowsDeleted = e.AffectedRows

EndSub

HTH

Monday, March 26, 2012

genral network error on .net framework 1.1 using system.data.sqlclient in asp .net

hi i am using asp .net 1.1

i have deployed my application on server where sql server 2005 exists but if i try to connect to sql server from my development machine then it is not connecting and gives me error when

conn.open()

in my sql server it is windows authentication.

the error is general network error check network docs.

i have tried timeout=0 and pooling=false

but neither works please answer.

what should my connection string.

you're in the wrong forum for this question. this forum is for SQL Server 2005 Mobile Edition. I'd recommend one of the ASP.NET MSDN Forums for this question.

Darren

Friday, February 24, 2012

Generate database script does not include database role members

I have read in the connect website (https://connect.microsoft.com/
SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125021)
That this issue was resolved in SP2. I have SP2 installed and still
have the same problem.
Am I missing something ?
-Noel
I looked under Tools | Options | Scripting and expected to see a new option
there, but did not find one. :-(
FWIW, I voted "5" on both 265852 and 125021.
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
<isyourfriend@.gmail.com> wrote in message
news:1175102798.822976.257790@.n76g2000hsh.googlegr oups.com...
>I have read in the connect website (https://connect.microsoft.com/
> SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125021)
> That this issue was resolved in SP2. I have SP2 installed and still
> have the same problem.
> Am I missing something ?
> -Noel
>
|||(isyourfriend@.gmail.com) writes:
> I have read in the connect website (https://connect.microsoft.com/
> SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125021)
> That this issue was resolved in SP2. I have SP2 installed and still
> have the same problem.
> Am I missing something ?
I researched the issue and found that if you select "Script object permissions" it will script membership in user-defined roles, but not
in predefined roles like db_datawriter. I don't recall how SP1 worked;
maybe it did not script any membership at all. But in that case they
only fixed half the problem.
(And it's not intuitive that you need to select "Script object permissions".
I submitted
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=266078
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
|||On Mar 29, 6:18 pm, Erland Sommarskog <esq...@.sommarskog.se> wrote:
> (isyourfri...@.gmail.com) writes:
>
> I researched the issue and found that if you select "Script object permissions" it will script membership in user-defined roles, but not
> in predefined roles like db_datawriter. I don't recall how SP1 worked;
> maybe it did not script any membership at all. But in that case they
> only fixed half the problem.
> (And it's not intuitive that you need to select "Script object permissions".
> I submittedhttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?Fe...
> --
> Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
I am totally disappointed about the way M$ is handling BUGs that were
100% non existent on previous releases.
Thanks for the feedback.
-Noel