Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

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.

Monday, March 19, 2012

Access web application is slow, should I upgrade to SQL server?

Hi,
first time poster/newbie here.
I've got a football (soccer for the yanks!) predictions league website that is driven by and Access database. It basically calculates points scored for a user getting certain predictions correct. This is the URL:
http://www.pool-predictions.co.uk/home/index.asp
There are two sections of the site however that have almost ground to halt now that more users have registered throught the season. The players section and league table section have gone progressively slower to load throughout the year and almost taking 2 minutes to load.
http://www.pool-predictions.co.uk/home/players.asp?tab=a_d
http://www.pool-predictions.co.uk/home/table.asp
All the calculations are performed in the Access database Ive written and there are Access SQL queries to get the data out.
My question is, is how can I speed the bloody thing up! ! Somone has alos suggested to me that I use stored procedures and SQL Server to speed things up? Ive never used SQL Server before so I am bit scared about using it (Im only a hobbyist), and I dont even know what a SP is or does. How easy will it be upgrading the whole thing to SQL Server and will it be worth the hassle, bearing in mind I expect my userbase to keep growing? Do SP help speed things up significantly? Would appreciate some advice!
Thanks in advance,
John.

This is one of those how long is a piece of string questions....

In general I woudl recomend Access Db apps with more than 5/20 users upgrade to a version of SQL Server.

An SP is a way of capturing logic and running it inside the server, if your app brings back lots of data and then processes in the web page then its likely that an SP will be faster, but it depends on the logic. Its faster because you can be more selective with the data, you are not pullng a lot of unused data over the wire etc.

Do you know which parts of the app are slow? specific queries? you could try running it ona local machine using both access and sqlexpress and compare the perf to see.

Access vs MSDE

Currently developing a website with Access Db at the backend which needs to synchronise with another Access Db. I have assumed that I should migrate this to MSDE with replication to go live ... but can/should I stay with Access ?
Replication is possible within Access, & is easier to setup. However, you
then need to run the Syncronization Manager which has the annoying 'feature'
of leaving a taskbar item running at all times.
Your requirement to upsize to SQL Server should consider more than just the
need for replication such as:
1. The number of concurrent users expected.
2. The required availability of the db.
3. The backup requirements.
And many more...
Many books on Access & SQL Server discuss this in detail, but if your only
reason for upsizing to SQL Server is for replication, it probably isnt
necessary...
Cheers,
James Goodman
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message
news:6812B4CA-F321-4312-8EF6-8077C25215D4@.microsoft.com...
> Currently developing a website with Access Db at the backend which needs
to synchronise with another Access Db. I have assumed that I should migrate
this to MSDE with replication to go live ... but can/should I stay with
Access ?
|||Thanks James.
I take your point re the other requirements and I'm trying to knock them off one by one but I'm finding it quite difficult to get any definitive answers (especially given the MSDE 'Governor' problem). Also its difficult to judge what some of the variables
may be (e.g. concurrent users could be loads if the web-site is popular or zilch if not!). I'm having to juggle the needs (and lack of funds!) of a small business start-up and guess a lot of it!
Could you recommend any particular books/sites that do good comparisons ?
|||There are licensing implications with making SQL Server data available from
the intranet & internet. I believe they are as follows:
For intranet access Per Seat licensing is ok, as long as you have enough
CALS to cover all users.
For internet access, Per Server licensing is required.
You should therefore be using SQL Server Standard edition at least.
If keeping costs down is important, I would probably recommend using Access.
You can upsize fairly simply should it be required in the future, but you
cannot easily downsize.
This link might help you with regards to the governor:
http://msdn.microsoft.com/library/de...r_sa2_0ciq.asp
http://msdn.microsoft.com/library/de...sderoadmap.asp
Doing a google groups search for similar posts will probably return some
good results as well...
Cheers,
James Goodman
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message
news:BF1BCA42-9559-4C22-A31F-6314AA80F2A6@.microsoft.com...
> Thanks James.
> I take your point re the other requirements and I'm trying to knock them
off one by one but I'm finding it quite difficult to get any definitive
answers (especially given the MSDE 'Governor' problem). Also its difficult
to judge what some of the variables may be (e.g. concurrent users could be
loads if the web-site is popular or zilch if not!). I'm having to juggle the
needs (and lack of funds!) of a small business start-up and guess a lot of
it!
> Could you recommend any particular books/sites that do good comparisons ?
|||Thanks for the links - the second one is really good!
fyi I think the licensing is OK for MSDE on the web tho' (see http://www.microsoft.com/sql/msde/howtobuy/msdeuse.asp)

Sunday, March 11, 2012

Access to TableAdapter Object in WebPage Class.

Hi, I'm using Reporting Services on my website and for some reports, i get the timeout error after 30 secs.

I declared my object using the Reporting tools and I am using ObjectDataSource.

My report is declared in my aspx page:

<rsweb:reportviewer id="ReportViewer1" runat="server" font-names="Verdana" font-size="8pt" Width="100%" Height="600px">

My ObjectDataSource is declared in my aspx page under my report tag:

<asp:ObjectDataSource ID="ObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="ReportsTableAdapters.ViewingTotalsTableAdapter">

My TableAdapter is declare in my Reports.xsd file:

<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ViewingTotalsTableAdapter" GeneratorDataComponentClassName="ViewingTotalsTableAdapter" Name="ViewingTotals" UserDataComponentName="ViewingTotalsTableAdapter">

I am trying to access the TableAdapter object from my WebPage Class on the Page_Load event , so I can modify the Command.CommandTimeout. Unfortunately, I cannot find a way to have access to the TableAdater object.

Anyone has any suggestion ?

Thanks,

Richard

Did you ever get a response to this? I am having the same problem.

Access to TableAdapter Object in WebPage Class.

Hi, I'm using Reporting Services on my website and for some reports, i get the timeout error after 30 secs.

I declared my object using the Reporting tools and I am using ObjectDataSource.

My report is declared in my aspx page:

<rsweb:reportviewer id="ReportViewer1" runat="server" font-names="Verdana" font-size="8pt" Width="100%" Height="600px">

My ObjectDataSource is declared in my aspx page under my report tag:

<asp:ObjectDataSource ID="ObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="ReportsTableAdapters.ViewingTotalsTableAdapter">

My TableAdapter is declare in my Reports.xsd file:

<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ViewingTotalsTableAdapter" GeneratorDataComponentClassName="ViewingTotalsTableAdapter" Name="ViewingTotals" UserDataComponentName="ViewingTotalsTableAdapter">

I am trying to access the TableAdapter object from my WebPage Class on the Page_Load event , so I can modify the Command.CommandTimeout. Unfortunately, I cannot find a way to have access to the TableAdater object.

Anyone has any suggestion ?

Thanks,

Richard

Did you ever get a response to this? I am having the same problem.

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?