Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Sunday, March 25, 2012

Accessing domain user name as a report parameter

In our legacy reports (ASP.NET/Crystal Reports) we use the logged in user account to filter the report.
Basically you are restricted to seeing your 'own' data when running the report based upon your user ID.
I am looking for suggestions as how to restrict report results based on something like domain user ID in Reporting Services.
There are many cases (like in the sales profession) where users of the same report do not want other users to access their information.
Thanks for any suggestions.use the global variable User!UserID
be aware that you may not create subscriptions for a report that contains user-defined parameter values.

Accessing directly to a Full Index Catalog

Hi,
Suppose that I have a Full Text catalog that indexes 3 tables. I want to search from an asp page for some text in the tables. How can I perform this search directly in the catalog ? Right now I must perform 3 queries, one for each table, but then I must
store the parcial results and in the end order by rank the retrieved results. This doesn′t seem to be a good solution. Does any one know if I can do this with the ixsso object (Query and Util)?. Any ideas ?
Thanks in advance.
Bart.
Bartolomeu,
Unfortunately, direct access to the FT Catalog files is not supported in SQL
Server 2000. However it has been reported publicly by Microsoft that it will
be supported via a command line utility in SQL Server 2005 (Yukon).
For SQL Server 2000, you must rely on using the FTS predicates of CONTAINS*
or FREETEXT*.
Regards,
John
"Bartolomeu" <Bartolomeu@.discussions.microsoft.com> wrote in message
news:90467F8E-3CFD-430A-A155-4BA09806F7CB@.microsoft.com...
> Hi,
> Suppose that I have a Full Text catalog that indexes 3 tables. I want to
search from an asp page for some text in the tables. How can I perform this
search directly in the catalog ? Right now I must perform 3 queries, one for
each table, but then I must store the parcial results and in the end order
by rank the retrieved results. This doesnt seem to be a good solution.
Does any one know if I can do this with the ixsso object (Query and Util)?.
Any ideas ?
> Thanks in advance.
> Bart.

accessing database problem

Hello friends when I am working in VWD and accessing sql data this error came?

I am using asp.net visual web developer edition and sql server 2005 expressedition.

plz check it out and help me.

The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +171
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2406
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +34
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +223
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +371
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +184
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +501
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +510
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
System.Data.SqlClient.SqlConnection.Open() +159
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +118
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +82
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1653
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +82
System.Web.UI.WebControls.ListControl.PerformSelect() +18
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5684



Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

Hi radhekrishna,

The error message indicates that either the database file you are trying to attached has already been attached in sql express or there is data corruption in your database file(.mdf file) , thus the db file could not be attached. I would suggest you connect to your sql express server through management studio to make a verification (Note here that since Sql Express use customer instance, in management studio, you must login using the same account as the one you used in your application). If that db file has been attached, detach it and take another try.

If there is no such file attached already in your sql express, I would suggest you first attach that mdf file to your database. If you still get this error, it means that the mdf file is data corrupted (information in ldf file and mdf file does not match) and cannot be used anymore--You need to restore it then.

Hope my suggestion helps

accessing data related to current week from list of all weeks

hi friends,

I m new to asp.net... actually i have an application where the data for current week needs to be displayed from all the data present in different weeks.actually i want to retrieve the syllabus of current week from all weeks

i used the below query but itz not working

sqlString = "SELECT DATEPART(ww,sylWeeKID)AS Week FROM SylWeeks WHERE SyllabusIDFK= " & SylId & " GROUP BY DATEPART(ww,sylWeeKID) "

..can anyone suggest me how to retrieve data for current week , for a related item

thanks in advance

i need urgent help.

select begin_of_week = dateadd(week, datediff(week, 0, getdate()), 0),
end_of_week = dateadd(week, datediff(week, 0, getdate()) + 1, -1)|||

You can try the following:

SELECT *FROM SylWeeksWHERE sylWeeKID>=dateadd(wk,datediff(wk, 0,getdate()), -1)AND sylWeeKID<dateadd(wk,datediff(wk, 0,getdate())+1, -1)
|||

could you try following

select * from tablename where datepart(wk, datefiled) = datepart(wk,getdate())

thanks,

satish.

|||

Hi khtan,

Thanks alot for your help,

actually the query that u sent helped me with little modification...actually i wanted to select sylweeksid

condition 1: where syllabusIdfk="& sylId & ",which is a foreign key

condition 2: sylweekid should return only current week criteria...that worked...which uu suggested

but i wanted to have condition 1 also in it...it is not working in any respect ??

i did following:

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate=dateadd(week,datediff(week,0,getdate())+1,-1)) "

but its not working

can u help.

thanks

overview:

tablename1: sylweeks----fields--sylweekid(primary key),sylweekcode,syllabusidfk(foreign key) ,sortorder--startdate,enddate

tablename2: syllabus--fields syllabusid(primary key),ImeIdfk(foreign key),course id

|||

Hi limno,

Thanks alot for your help,

actually the query that u sent helped me with little modification...actually i wanted to select sylweeksid

condition 1: where syllabusIdfk="& sylId & ",which is a foreign key

condition 2: sylweekid should return only current week criteria...that worked...which uu suggested

but i wanted to have condition 1 also in it...it is not working in any respect ??

i did following:

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate=dateadd(week,datediff(week,0,getdate())+1,-1)) "

but its not working

can u help.

thanks

overview:

tablename1: sylweeks----fields--sylweekid(primary key),sylweekcode,syllabusidfk(foreign key) ,sortorder--startdate,enddate

tablename2: syllabus--fields syllabusid(primary key),ImeIdfk(foreign key),course id

|||

Hi limno,

Thanks alot for your help,

can u check my query in one of the replies, i m not able to duplicate it.

thanks

|||

hi satish

thanks for your help,

can u check my query ,i m not able to duplicate it.

thanks

amanat

|||

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

|||

Hi limno,

Thanks alot it worked...

thank u so much

amanat

i dont know how to give points at this time...but will surely

thanks alot

|||

Hi Limno,

I wan to add another query

Sqlstring1 = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ")order by sortorder"

which state that if there is no week that matches current date then first week present in database should be executed ..

please guide me where i should fix it

Public

OverloadsSharedFunction getFirstWeekId(ByVal SylIdAs Int32)AsInteger'this function returns the ID of the first week of the sylbi'It is used to seed the sylabus detail page when the page first loadsDim connAs SqlConnectionDim cmdAs SqlCommandDim countAs Int32Dim sqlStringAsString'Dim Sqlstring1 As StringDim drAs SqlDataReader

conn =

New SqlConnection

cmd =

New SqlCommand'the query

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

conn.ConnectionString = ConfigurationSettings.AppSettings("ConnStr")

cmd.CommandType = CommandType.Text

cmd.CommandText = sqlString

Try

cmd.Connection = conn

IfNot conn.State = ConnectionState.OpenThen

conn.Open()

EndIf

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

If dr.HasRows =TrueThen

dr.Read()

ReturnCInt(dr.Item(0))EndIf

Catch exAs ExceptionThrow exFinally

dr.Close()

EndTryEndFunction

---------------

If (Session("curWEEK"))IsNothingThen

week = -1

EndIf'The following case statement checks the value of weekSelectCase weekCase -1'if week is set to -1 that means the session variable curWEEK has not been set'hence this is possibly the initial rendering of the syllabus.' since this is the initial visit, the syllabus is rendered with' the first week of the syllabus.

week = daWeeks.getFirstWeekId(

CInt(Session("SylId")))

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))

Case 0'if week is set to 0 then the user has selected to view all weeks'so all weeks are rendered to the syllabus (this is can effect performance

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))CaseElse'if week is set to any other value, the user has selected to view a specific week'that week ID is the value of week' that specific week is rendered to the syllabus

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))EndSelect

|||

Hi Limno,

I wan to add another query

Sqlstring1 = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ")order by sortorder"

which state that if there is no week that matches current date then first week present in database should be executed ..

please guide me where i should fix it

Public

OverloadsSharedFunction getId(ByVal SylIdAs Int32)AsInteger'this function returns the ID of the first week of the sylbiDim connAs SqlConnectionDim cmdAs SqlCommandDim countAs Int32Dim sqlStringAsStringDim drAs SqlDataReader

conn =

New SqlConnection

cmd =

New SqlCommand

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

conn.ConnectionString = ConfigurationSettings.AppSettings("ConnStr")

cmd.CommandType = CommandType.Text

cmd.CommandText = sqlString

Try

cmd.Connection = conn

IfNot conn.State = ConnectionState.OpenThen

conn.Open()

EndIf

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

If dr.HasRows =TrueThen

dr.Read()

ReturnCInt(dr.Item(0))EndIf

Catch exAs ExceptionThrow exFinally

dr.Close()

EndTryEndFunction

---------------

If (Session("curWEEK"))IsNothingThen

week = -1

EndIf'The following case statement checks the value of weekSelectCase weekCase -1'if week is set to -1 that means the session variable curWEEK has not been set

week = daWeeks.getId(

CInt(Session("SylId")))

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))

Case 0

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))CaseElse'if week is set to any other value, the user has selected to view a specific week

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))EndSelect

Thanks alot once again for your kind help

|||

Hi Limno,

I wan to add another query

Sqlstring1 = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ")order by sortorder"

which state that if there is no week that matches current date then first week present in database should be executed ..

please guide me where i should fix it

Public

OverloadsSharedFunction getId(ByVal SylIdAs Int32)AsInteger'this function returns the ID of the first week of the sylbiDim connAs SqlConnectionDim cmdAs SqlCommandDim countAs Int32Dim sqlStringAsStringDim drAs SqlDataReader

conn =

New SqlConnection

cmd =

New SqlCommand

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

conn.ConnectionString = ConfigurationSettings.AppSettings("ConnStr")

cmd.CommandType = CommandType.Text

cmd.CommandText = sqlString

Try

cmd.Connection = conn

IfNot conn.State = ConnectionState.OpenThen

conn.Open()

EndIf

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

If dr.HasRows =TrueThen

dr.Read()

ReturnCInt(dr.Item(0))EndIf

Catch exAs ExceptionThrow exFinally

dr.Close()

EndTryEndFunction

---------------

If (Session("curWEEK"))IsNothingThen

week = -1

EndIf'The following case statement checks the value of weekSelectCase weekCase -1'if week is set to -1 that means the session variable curWEEK has not been set

week = daWeeks.getId(

CInt(Session("SylId")))

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))

Case 0

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))CaseElse'if week is set to any other value, the user has selected to view a specific week

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))EndSelect

Thanks alot once again for your kind help

Accessing Data directly from a SqlDataSource?

First let me give you a little back ground on me. I'm very new to the ASP, ASP.NET, Visual Studio, Sql Server, Frameworks...thing. I am coming over from a PHP/MySql background of over 5 years. The change over to VBScript and VB has been to tough and I have a basic liking for the Visual Studio 2005 and the ease of putting things together. However, I have come across something that to me seems like it should be relatively simple, but haven't been able to find the documentation or samples to describe what I'm looking to do.

Rough Need:

1. Start with a form will a couple labels and a singe textbox to get the lookup date from an user.

2. Query one table/view based on the users choice of date and select only one field of returned data.(Doing this by itself is not a problem and I can display my results in a Gridview, but this is where it starts getting tricky and the gridviews won't work for me.)

3. If there is something returned, I need to start a HTML table layout or possibly some form of a Gridview(I don't see how I would use the Gridview) and start a loop, adding the first returned row from this query into the first cell.

4. Now, based on that same User Date and the returned row value from the previous query, I need to query another Table/view and return another single field, which might return 1 or multiple rows, which I need to start a loop to display unique items in cells under the first on above.

5. Based on the original User Date and each returned row from the first query, I need to query two other Table/views and get some additional information. 4-5 fields will be returned and be displayed on one row in the number of necessary columns.

6. This would finish the first row from the first query, so I would need to loop back up to see if there were any further results and continue looping until the get to the last of the results from the first query.

7. Finally, I would just need to close up the Table/gridview.

The basic results I'm looking for would be similar to the following:

Results for 10/11/2005

Field name 1Field name 2Field name 3Field name 4Field name 5

First Result from query 1
1 of 4 results from Query 2, but only 1 unique result

Info from Query 3

Info from Query 3

Info from Query 3

Info from Query 4Info from Query 4Info from Query 3Info from Query 3.

Info from Query 3

Info from Query 4
Info from Query 4Info from Query 3

Info from Query 3

Info from Query 3

Info from Query 4
Info from Query 4Info from Query 3Info from Query 3

Info from Query 3

Info from Query 4Info from Query 4

Second Result from query 1
First result from Query 2 after looping though the first query
Second result from Query 2 after looping though the first query
Info from Query 3

Info from Query 3

Info from Query 3

Info from Query 4Info from Query 4Info from Query 3Info from Query 3.

Info from Query 3

Info from Query 4
Info from Query 4Info from Query 3

Info from Query 3

Info from Query 3

Info from Query 4
Info from Query 4Info from Query 3Info from Query 3

Info from Query 3

Info from Query 4Info from Query 4

It seems me from what I have read and slowly figuring out, is that I should be able to directly access the DataSet returned by four SqlDataSources, one for each of the above querys and then just write my own VB to handle the necessary looping, table format and such. I can easily add the for SqlDataSources to the page and add a Gridview for each one and get 4 separate chunks of info, but can't see a way with GridViews to intermingle the info like displayed above.

So, if it can be done with Gridviews, then I would love to see how that is done. But, if someone could explain to me how I access the DataSets directly that I get from the 4 SqlDataSources, then that would be ok too. I have figured enough out with VB, that I can write the code to do my looping requirements, if I can just access the information I get back. Thanks for reading all the way through this long post.

Jack

First let me apologize for the mis-spellings and the two links in my sample layout. I did some copy-n-pasting, then changed the wording, but forgot to remove the link behind. I didn't see any way on this forum to be able to Edit my own post to make the necessary corrections.

Second, is this as big of a problem as it seems, since know one made any replies to it? From what little research I've done, it looks like this should be possible with nested Repeaters, but I just can't seem to figure out how to put it all together so that the second SqlDataSource can use each returned value from the results of the first SqlDataSource to get the next set of records and then again with the third and fourth SqlDataSources.

If someone could just give a very short example of a form with a single texbox and submit button, that on postback, you could manually loop through the results returned by a single field onto the page, then I think that would give me some direction here. This is one of those cases that I don't think I want to use a Control to display the returned information, I just need to know how to manually access that returned info. Thanks again.

Jack

Thursday, March 22, 2012

Accessing ASP datasource results through VB code

I have the following datasource...

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ***%>"

ProviderName="<%$ ***%>"SelectCommand='SELECT "var1", "var2", "var3" FROM "tbl1"'>

</asp:SqlDataSource>

Would it be possible to use VB code to read the reasults from this datasource? (There are conditions that restrict me from running the query itself through VB code.)

As always, any help is greatly appreciated. Thanks!

you should use the connection and recordset that is intrinsic to vb....I am not sure you can use vb6 or vb5 to look into a dataset.

you could use vb.net but i am stating the obvious here...

actually i found this

http://www.dotnet247.com/247reference/msgs/15/75021.aspx

looks like you can do it but will need some extra code.

Accessing AS 2005 from ASP.NET application

I have an asp.net application. This application provide consolidated information to the user using Analysis Services 2005.
Within it, one aspx page uses MDX query to retrieve the information from the cube. However, we are unable to access AS 2005 because of authentication issues. What would be the easier to implement and deploy scenario?

How can I access AS 2005 from an ASP.NET application? Is there any feature to use?

Create Views and CTE( common table expressions ) with the results of the MDX queries and render the Views and CTEs in DataGridview controls. That means you are just calling Views query rewrites one persisted and the other in memory or virtual views in Asp.net. This keeps Analysis Service operation out of the Asp.net page life cycle. Hope this helps.

Accessing analysis services from asp.net application

I have an asp.net application. This application provide consolidated information to the user using Analysis Services 2005.
Within it, one aspx page uses MDX query to retrieve the information from the cube. However, we are unable to access AS 2005 because of authentication issues. What would be the easier to implement and deploy scenario?
1) Using kerberos
2) creating a webservice with some Identity to access AS 2005 and using an agent in the application;
3) some other mechanism.

Has AS 2005 come up with some mechanism to allow easy access from web applications (just like sql server authentication in SQL 2005). Is there any feature that we could use? What about anonymous access?

The closest thing we have with AS and sql logins, is http access. Using http access you can set a uid and pwd on the connect string and then the system will use those to authenitcate you against IIS (where the AS server is). This allows your ASP.NET application to use a canned account to access AS. See the connection string parameters allowed on ADOMD.NET (which is what you should be using as a managed provider for your ASP.NET application).

_-_-_ Dave

|||And how do you implement AS role-based security in this scenario?
If you use a canned account to access AS, you cannot match you users with an AS role.
Am I missing something ?|||You didn't say that you wanted to use role-based security, so I gave you a general answer. There are two issues here:

1) getting basic connectivity. If the IIS / ASP.NET machine is in a common domain then you can connect using normal NT authentication (run the virtual directory anonymously and do your own authentication within the application) -- have the anonymouse user for the vd to be a common domain account with the AS server and ensure that it is an Analysis Services sysadmin. If not in a common domain, then use http connectivity and specify an NT UID/PWD which is an AS sysadmin.

2) Once you are connected as an AS sysadmin, then you can use the new EFFECTIVEUSERNAME to set the appropriate username for the connection. Then BINGO there you are.

Hope that helps.

_-_-_ Dave

Accessing an SSRS report from the web, being prompted for Guest signon screen

I have a sql server 2005 application that uses asp and some canned reports that I built using SSRS. All reports run from the server but not when to try accessing from another computer on the network. I get a prompt from windows that requests me to enter a password for the Gurest account. The Guest account is not selectable. Does anyone know how to supress the signon page? I am using sql 2005 workgroup edition. I would like the users to go directly to the ssrs report without any logon screen.

Thanks

Rich

Hi,

I guess you enabled Simple File Shring on the computer you want to have access to. Switch it off by using the Explorer Menu --> Options --> Advanced --< Disable "Simple File Sharing". The computer will now prompt you for credentials as you will be not authenticated as a guest user.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

Jens,

I looked at my internet explorer optiions under in advanced settings, and do not see an oprion for "Simple File Sharing" to uncheck?

Thanks

|||

That in the service hosting machine, in the Options of the Explorer, not the internet explorer.

-jens.

|||

Jens,

What explorer are you talk about? Could you be more specific. Been looking all over for that option on my server machine.

Thanks

Rich

|||Are you running on an WinXP box? Are you using Windows authentication on your virtual directories? If so try forcing NTLM (see workaround section in http://support.microsoft.com/default.aspx?scid=kb;en-us;871179). If it works for you then we can be pretty certain that it is a kerberos issue. Either follow the "workaround" or the "resolution" in the KB article.|||

James,

I am running windows XP, and Windows Authentication on virtual Directories. The web application works fine reading and writing to sql server. It only prompts me for guest signon screen when I select a report that was published to reporting services report. The TreeNode code that runs the report s displayed below:

<asp:TreeNode NavigateUrl="http://promsvr/ReportServer/Pages/ReportViewer.aspx?%2fPromshop+Reports%2fSalesReceipt&rs:Command=Render" target="content" Text="Sales Receipt" Value="SalesRpt"></asp:TreeNode>

I ran the workaround from the article and got the following results that matched the article. The following text was returned:

NTAuthenticationProviders : (STRING) "NTLM"

I have the same problem when accessing the report from a client machine. I could not do the resolution from the article as I do not know how to get

IIS_computer's_NetBIOS_name DomainName\UserName
computer's_FQDN DomainName\UserName

My Virtual Web Settings are:

Virtual Web Server:

Anonymous access checked; User Name: IUSR_PROMSVR; Password: *********; Allow IIS to control password is selected; Integrated Windows authentication is selected

Virtual Reports

Only Integrated Windows authentication is checked

Virtual ReportServer

Only Integrated Windows authentication is checked

|||

Just want to confirm: did the workaround solve your problem? What are the OS on your client machine and RS server machine?

I don't know a definitive way of finding out NetBIOS and FQDN. For NetBIOS name, run "nbtstat -n". It is basically the shortname of your server. For FQDN, find out your DNS suffix by running "ipconfig /all", and prepend the NetBIOS name to DNS suffix. For example, you NetBIOS name may be "myserver", and FQDN may be "myserver.mycompany.com". The DomainName\UserName is the domain account that the RS app pool is running under.

You mentioned Virtual Web Server. What is this?

|||

I figured it out, I turned simple file sharing off in explorer.

Thanks everyone for all there help....

Tuesday, March 20, 2012

Accessing a database from another project

Hay there,

I have an asp.net project website with an sql Database. I need to access this same database from another project (a class library that needs to access this database). In fact i want to be able to use the tableadapters that I have implemented for my database in this new class library..

I guess it has to do something with making my database not part of the website but and independemt entitiy that can be seen by others.... I cannot seem to find a way to do that can anyone help meee ??

Thanks for your time!

If its a database then how is it tied to application.

Atleast It must have the mdf files which you can create a real independent entity and then play wiith it using connection strings.

|||

All your databases resides in a databse server (e.g. MS SQL Server 2005).

What you need is to point your ConnectionString from your application to that database.

My guess is, you have two projects (e.g. ProjectA and ProjectB) and thay are using diffrent databases but in some part of ProjectB needs to use the same database of ProjectA.

So, you should have two ConnectionStrings for ProjectB. One you will use it for most part of the project and it is specific to ProjectB (keep it in Web.Config file) while you need another ConnectionString that will access the database (which ProjectA is using it) from ProjectB.

Here, have another ConnectionString in the web.config file of ProjectB and lets it point to the same database used by ProjectA.

Good luck.

|||

Hi,

Thanks for your very clear reply and clarification.

I can't seem to apply your reply to my situation as My project B is just a class library i.e. I have no webconfig ...

Note that project A and Project B are part of the same solution too.

Thanks for your help.

|||

Hi ekosha,

Why you have the databse within the project itself?!

|||

Well good question, Well I was just implementing this application then and didn't think I would need to use it from another project. seems that was a wrong decision any idea how I can fix that?

|||

ekosha:

Well good question, Well I was just implementing this application then and didn't think I would need to use it from another project. seems that was a wrong decision any idea how I can fix that?

This database has a file with .mdf extension, take that file and attached to a new database in MS SQL Server.

Now, you can use that database for all your projects (even if they are within one solution).

Good luck.

Accessing 64-bit MS SQL Server 2005 from classic ASP

I'm considering shifting my database server to 64-bit MS SQL Server 2005 for improved scalability and performance. I'm concerned, however, that my classic ASP website (which sits on a separate server) may have problems communicating via ADO/OLEDB because of communication problems between 32-bit IIS on the web server and 64-bit MS SQL Server on the database server.

My current set up (which works fine) is:

Web Server: Windows Server 2003, Standard Edition, SP1 - running IIS with a set of ASP websites
Database Server: Windows 2000 SP4, running MS SQL Server 2000

Connection String:

MyConnection="Provider=SQLOLEDB;Network Library=DBMSSOCN;SERVER=192.168.0.1;INITIAL CATALOG=MyDatabase;UID=MyUserID;PWD=MyPassword"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open MyConnection

My core question is:

If I change my database server to new machine with 64-bit Windows Server 2003 running 64-bit MS SQL Server 2005, will my (32-bit) web server be able to connect from ASP as it does now?

Thanks for your help!
Jed

I've now answered this question via another channel. Thanks.

Accessing 2005 Reports from asp.net 1.1

Our web based Application is based on ASP.NET 1.1 and SQL Server 2005.
Can we use 2005 Reporting Services (ASP.NET 2.0) to create and publish
reports and use them in the 1.1 Application?
(We need to change the Data Source at run time, which is not easy or not
possible in 2000 Reporting Services).
Thanks in advance,
BenjaminIn order to display a report you need just an URL. What seems to be a
problem?
You can view any url in your 1.1 application, even from a different web
site.
Just redirect to it or grab an ouput and display it in your application.
If you have a way of changing datasource in runtime in RS 2005, just create
a 2.0 web page, which does it on load and redirect/transfer from it to the
the report of your choice.
"Benjamin" <benjamin@.servue.com> wrote in message
news:ORZ$mvz9GHA.4196@.TK2MSFTNGP03.phx.gbl...
> Our web based Application is based on ASP.NET 1.1 and SQL Server 2005.
> Can we use 2005 Reporting Services (ASP.NET 2.0) to create and publish
> reports and use them in the 1.1 Application?
> (We need to change the Data Source at run time, which is not easy or not
> possible in 2000 Reporting Services).
> Thanks in advance,
> Benjamin
>

Accessing 2 databases on the SQL server through ASP.net

Hi everyone,

First of all I'd like to say I'm new to the forums, and in fact new to ASP.net.

I've had a couple of applications running in VB.net for the last year or so that I now am looking to move on and into ASP.net (main reason is to do with implementation to remote sites in foreign countries).

I'm currently following through the "Working with data and ASP.net 2.0" walkthrough on this site, which I must say has been a great help.

I'll start with the background stuff firstSmile

I have my main database on an SQL server. I also have 2 other databases on there - Customer and Employee. The reason for these are that they are shared amongst my VB applications and I kept them as seperate databases so that one database is all that needs to be administered and maintained, and these changes are then seen on both apps (takes away redundant data as well).

In my main database, main table, is a field called CustomerID. This value relates to the CustomerID in the Customer table. In my VB app all I do is have the user select a customer name, and then the customer ID value is copied to the CustomerID field of my main table when inserting / updating a row. This is simply accomplished with 2 SQL connections and 2 dataAdapters. I also use 2 dataSets - one for Customer, one for WorkRequests (the main database)...

I use ComponentOne stuff so that my grid will show the CustomerName instead of the CustomerID etc, and the same applies when I use my Employee database - I run many dataAdapters to this for things such as Account Manager, Technologist, Creator, UpdatedBy etc etc.

Now, I'm new to VS 2005 - my apps were created in VS 2003 and .net 1.1. Can I easily re-create my apps in ASP.net? My primary goal at the moment is to make sure I can load a row, and display the "lookup" values instead of the "integer" value. As my tables are in seperate databases, I would like to know the best way of accomplishing this, if it is of course possible.

Help and advice much appriciated.

Kind Regards,

Luke

SQL supports 4-section object name, in?the?format?of?server.database.owner_name.object_name,?so?just?add?database?part?when?you?want?to?refer?to?object?in?other?database.?For?more?information,?please?refer?to:?Using Identifiers as Object Names|||

Thank you very much, you reminded me about that, I think I looked into it ages ago but then put it to the back of my mind.

To display my CustomerName field by linking to the CustomerID field I'm using;

SELECT npd_dwr.dbo.dwr.dwrnumber, npd_dwr.dbo.dwr.customerid, customerdb.dbo.customer.customername
FROM npd_dwr.dbo.dwr
INNER JOIN customerdb.dbo.customer ON npd_dwr.dbo.dwr.customerid = customerdb.dbo.customer.customerid

Thanks again,

Regards

Sunday, March 11, 2012

Access to the ADO.net Managed Provider SqlClientFactory was denied

In a previous post in Installation and Setup I was having problems just getting an ASP.NET 2.0 app to run on my web server. Now I'm having some different weird security issues.

I'm getting this message when just trying to open a database and put its contents into a gridview.

Access to the ADO.net Managed Provider 'SqlClientFactory' was denied in the data source with ID 'sqlEmployees' because of security settings.

I think this may have to do with our web server and our SQL server being separate machines. That always gives us issues. But I have impersonation=true in my web.config along with windows authentication and I have SQL Server configured with Windows and SQL authentication so things should be right, I'm thinking.

Any ideas??

I guess I stumped everyone. Thanks anyways.|||

Did you find the solution? If so please post it, so that it will help others :)

|||Had the same problem. There was a web.config in the root directory, deleted it and solved the problem

Tuesday, March 6, 2012

Access SSAS 2005 Data from Java

I have a C# ASP.NET 2.0 application that is using ADOMD to access my cube data in SSAS and it works very well.

I have another project in Java and would like to integrate SSAS cube data. Is this possible? I know Microsoft makes SQL Server drivers for Java. Is there anything like ADOMD for Java? If not, is there a OLAP type tool that is similar to SSAS that is Java friendly?

I know Java and Microsoft are usually competing and incompatible technologies. Please don't tell me to switch or turn this into a political thread.

Any tips are greatly appreciated.

Thanks in advance!
use XMLA. there are plenty of opensource solutions and examples it about.|||

Here are links to two good open source tools which use Java to access Analysis Services through XMLA:

1. JPivot http://jpivot.sourceforge.net/

2. REX http://sourceforge.net/projects/whex/

Access SSAS 2005 Data from Java

I have a C# ASP.NET 2.0 application that is using ADOMD to access my cube data in SSAS and it works very well.

I have another project in Java and would like to integrate SSAS cube data. Is this possible? I know Microsoft makes SQL Server drivers for Java. Is there anything like ADOMD for Java? If not, is there a OLAP type tool that is similar to SSAS that is Java friendly?

I know Java and Microsoft are usually competing and incompatible technologies. Please don't tell me to switch or turn this into a political thread.

Any tips are greatly appreciated.

Thanks in advance!use XMLA. there are plenty of opensource solutions and examples it about.|||

Here are links to two good open source tools which use Java to access Analysis Services through XMLA:

1. JPivot http://jpivot.sourceforge.net/

2. REX http://sourceforge.net/projects/whex/

Saturday, February 25, 2012

Access SQL Server 2005 database using a published website

Hi all,

I am stuck with a problem using ASP.Net website. I created a website which accesses a database table in SQL Server 2005. The default.aspx is a form which inserts/updates/deletes data from the database. After creating the website I published it to IIS (Inetpub -> wwwroot). When I use Visual Studio 2005 and build the website and start with debugging. the form comes up and i can insert/update or delete the data from the table as I want. Now, as I have the website published I can access the form from another sharepoint website using the url as

/Employee_Data/Default.aspx">http://<mydesktop>/Employee_Data/Default.aspx

the form shows up but I am not able to access any of the database. I do not see any errors either. Once I click on the button the page just refreshes but nothing else happens. I have my web.config as :-

<?

xmlversion="1.0"?>

<

configuration>

<

appSettings/>

<

connectionStrings/>

<

system.web>

<

compilationdebug="true"/>

<

authenticationmode="Windows"/>

</

system.web>

</

configuration>

Am I missing something? Ieven have Anonymous access in the IIS inetpub properties. I can even the database as I am the administrator.... I appreciate your suggestions.

Thanks,

Kavya

Can you post your connection string as well as SQL commands? Can you connect to the SQL Server from the machine (on which you can access the published website) via Management Studio?

Friday, February 24, 2012

Access Reports using ASP.net application?

Hi,
I am currently exploring Reporting services. I have created a simple report and would like to give access to my reports inside my asp.net application.
Can someone help me on how to go about doing this.
Thanks.

Hi eeyore21

The easiest way to do this is to create an IFRAME obtject and point the souce to the reportserver URL.
You could check out posting 'Adding Parameters from .ASPX file'on this forum. I posted some simular info there
,L0n3i200n

|||You can also use the rendering methodology. Go to and look up Reporting Services Renderingwww.microsoft.com
and search for Reporting Services Rendering. They have examples thatwill allow you to use reports in your asp.net app. I actually havearound 14 reports that are a part of a web app that I created inASP.Net that use this method.

Thursday, February 16, 2012

Access Locking problem

I've been working on this problem for days and cannot seem to figure it out. I'm using the Microsoft Access Driver in an ASP web page to try to update a database. I'm using adLockPessimistic, but it is acting like I'm using adLockOptimistic.

Before you ask, I'm using MDAC 2.8 SP2 on my Windows 2003 Server.

If I open two web pages at the same time, both trying to increment a counter in a database 100 times, the end result should be a value of 200. But in most trials, I get a number less than 200, like 187. It almost seems like it is not locked at all, ecept for the fact that I sometimes get an error telling me I can't update the data because it is locked by another user.

So... I can read OK, but not save because sometimes its locked by another user and sometimes the increment doesn't really increment, therefore it seems like I have adLockOptimistic instead of adLockPessimistic. I do get adLockPessimistic when I read back the lock type.

Any help would be great!

Code Snippet

for i = 1 to 100
if ( len(Request.Form("zipcode")) > 0 ) then
call LogImpression (38)
end if
next

Function LogImpression (CampID)
'This increments the impression counter for a campaign in the vendors database
On Error Resume Next

Set adoCon = Server.CreateObject("ADODB.Connection")
'adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("accessdb/vendors.mdb")
adoCon.Open "DSN=vendorDB"
Set rsAddComments = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT vendors.impressions,vendors.ID FROM vendors WHERE ID=" & CampID & ";"
rsAddComments.CursorType = 2
rsAddComments.LockType = 2
rsAddComments.CursorLocation = 2

rsAddComments.Open strSQL, adoCon, 2, 2, adCmdTableDirect
if (NOT rsAddComments.EOF) then
Err.Clear

MyCount=CInt(rsAddComments.Fields("impressions")) + 1
rsAddComments.Fields("impressions") = MyCount
rsAddComments.Update

if Err.Number <> 0 then
'we had an error, row was locked
Err.Clear

MyCount=CInt(rsAddComments.Fields("impressions")) + 1
rsAddComments.Fields("impressions") = MyCount

rsAddComments.Update
end if

end if
rsAddComments.Close

Set rsAddComments = Nothing
Set adoCon = Nothing
end function

Thanks, Lee

Your code itself doesn't lock this critical section. You cannot consider these two statements to be atomic. You have two database operations going on, and you are trying to run them atomically, so your code needs to lock around that area or you need to wrap the commands in transactions.

Here is the scenario you have right now:

Assume that the database starts with "impressions" set to 1:

process A updates MyCount = impressions + 1 = 2 then context switches out

process B updates MyCount = impressions + 1 = 2 then context switches out

process A sets impressions = MyCount = 2 then context switches out

process B sets impressions = MyCount = 2 then context switches out

These concurrency issues do not happen all the time, and are hard to reproduce, but this is clearly an application level concurrency issue.

I suggest wrapping those two lines in a critical section to enforce serialization there.

Hope that helps,

John

Access is denied: 'Interop.ADODB'.

I am using a com component in my asp.net programme and it was working fine for many days . now I am getting following error .

Source Error:

Line 196: <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>Line 197: <add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>Line 198: <add assembly="*"/>Line 199: </assemblies>Line 200: </compilation>


Source File: c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config Line: 198

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Interop.ADODB' could not be loaded.

=== Pre-bind state information ===LOG: DisplayName = Interop.ADODB (Partial)LOG: Appbase = file:///e:/inetpub/wwwroot/SAPTRainingLOG: Initial PrivatePath = binCalling assembly : (Unknown).=== LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Post-policy reference: Interop.ADODBLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/saptraining/8932fe97/1bed5ea1/Interop.ADODB.DLL.LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/saptraining/8932fe97/1bed5ea1/Interop.ADODB/Interop.ADODB.DLL.LOG: Attempting download of new URL file:///e:/inetpub/wwwroot/SAPTRaining/bin/Interop.ADODB.DLL.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Post-policy reference: Interop.ADODB, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null


Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300

How this can be solved ? Please help

Something has probably changed.

Check that the config file still contains a valid configuration, and that the file(s) that are needed for your app still are at the expected place(s). ie paths, filenames etc...

/Kenneth