Sql Transactions Tiers Applications

Aug 3, 2006

Hi All.. I have an 3 tier web applications and I want to use sql transactions but not in each class.

Example :

I have 3 clases who need to update each table in one transaction how I do use sql transactions. I try to do in this way but not work:

sub cmdupdate_click
   dim a as new class1
   dim b as new class2
   dim c as new class3
   dim cn as new sqlconnection......
   cn.open
   .....transactions.... scripts
   a.cn =cn ...I pass the same connection via property to each class
   a.update
   b.cn=cn....
   b.update
   c.cn=cn.....
   c.update

   Transaction...scripts to commit
   cn.close
end sub


maybe that logic is incorrect.  I dont now is my explain is clear.

 

 


 

 

View 3 Replies


ADVERTISEMENT

Build SQL Statement To Show Some Tiers

Jun 8, 2005

in my relational sql db structure I have some items and its children, grandchildren itemsto print these values do i need to build one sql statement for each tier?into my sproc i tried something as following but it returns me only the last tierSELECT * FROM AINNER JOINB ON A.field1 = B.field2INNER JOINC ON A.filed3 = C.field4WHERE A.filed1 = @myParam
thanks a lot

View 1 Replies View Related

Dev. Team - Keeping Three Tiers In Sync

Jul 23, 2005

This may not be a MSSQL-specific question, butI wanted to ask it here first, in case there'sa MSSQL and/or SourceSafe solution that will help.Our dev team is having some difficulty withkeeping the nightly builds in sync with thestored proc mods. I'm wondering if there aresome good case studies on how to avoid this"drift". Something like genning a new DB fromchecked-in SPs, etc. alongside each regular build,then always have a paired enterprise app/databaseduo that is tagged and added to a history.FWIW, we have a 3-tier .NET/C# app, andADO.NET is throwing exceptions every otherday.If the suggestion is to whip the DB guys, thatworks for me as well. ;-)Nah, there's much love there.Thanks in advance,~swooz

View 2 Replies View Related

Changing Connection Transactions To Database Transactions

May 22, 2005

Hi there,
I have decided to move all my transaction handling from asp.net to stored procedures in a SQL Server 2000 database. I know the database is capable of rolling back the transactions just like myTransaction.Rollback() in asp.net. But what about exceptions? In asp.net, I am used to doing the following:
<code>Try   'execute commands   myTransaction.Commit()Catch ex As Exception   Response.Write(ex.Message)   myTransaction.Rollback()End Try</code>Will the database inform me of any exceptions (and their messages)? Do I need to put anything explicit in my stored procedure other than rollback transaction?
Any help is greatly appreciated

View 3 Replies View Related

How Can I Connect To .MDF Through 2 Applications?

Dec 2, 2006

Here is the big problem:

I am using ASP.NET 2.0 login control. this control connect to ASPNET.MDF database.
I built another application using windows service, and this application also connects to ASPNET.MDF database.
problem is that the first application that connects to the database, locks the database, and so the other application cannot use the database untill the other application is closed.
I am going on circles about this, and just don't know what to do.
Please please please. love me do.
 
 

View 1 Replies View Related

MSDE For Web Applications

Dec 10, 2003

Hi, I am needing help on which MSDE version support 25 concurrent users. Can anyone help?

Creating an intranet that I would like to run on msde. My problem is that it wont allow more than one person to access the intranet at a time.

MSDE is running on windows 2000 with IIS.

View 1 Replies View Related

SQL Express Db With Both Win / Web Applications

May 17, 2006

I have a SQLexpress db that i would like to be able to access from both a windows app and web app (both running on the same machine) at the same time.  Is this possible. I've been able to connect either one or the other, but not both at the same time.
Thanks   

View 1 Replies View Related

2 Web Applications To Same Sql Server

Nov 2, 2000

If there are 2 different web application connecting to a sql server database through ODBC connection, both of them have full privilege to update , create , add column etc. Would there any issues of SQL server impacts when actually on live.

View 2 Replies View Related

Accounting Applications

Dec 11, 2001

Hi to all..
Does anyone know about some useful resources of programming Accounting and General Ledger applications..SQL scripts,books..etc.
Thanks to all..

View 7 Replies View Related

Find Out Applications

Aug 3, 2007

how do i find out what application is using certain DB?.


=============================
http://www.sqlserverstudy.com

View 3 Replies View Related

Web Applications And SQL Server

Jan 11, 2008

Hi all,

Can anyone tell about impact of SQL server in web applications


Thanks in advance

View 2 Replies View Related

Deployment Of Applications

May 23, 2007

Hi,



I have developed several PPC apps in VS2003, which i have deployed to other PPCs using sqlce.wce4.armv4.CAB for the database runtime.



Now I developed a new app. version in Visual Studio 2005, using the free SQL server express database that came with it.



I can create a .cab file for the app using a setup project, but it eludes me what to install on the PPC of the customer, database wise.



Is there some kind of installable runtime for sql server express ?

(Or what is it called today ?)



thx in advance,

Paul.

View 1 Replies View Related

Why Can't Applications See My SQL Server?

Jul 6, 2006

I am running SQL Server 2005 Dev x86 with SSRS SP1 on Windows2003 Svr SP1.

My SQL Server is running and SSRS is working. When I come to run certain installs though, my Server name is not present in the dropdowns or in the browse for installed server lists.

I entered the name of my SQL server manually, but when I ran the application, it gave me an error: 00250 unable to run dtabase locator service.

Any ideas?

View 2 Replies View Related

Restoring Db From Web Applications..

May 17, 2007



i am a computer sciences engineering student and and we have an assignment to create a web project with a database.



Our lecturers will store our submissions on a db server but they want our projects enable the restoring our own databases..



that is, they wanna be able to have a copy of our databases to a new db that they have just created.. and they want us to enable this feature in an install.aspx page in our project.. the new db is guaranteed that will have the same name as ours..

so now what i am supposed to include in install.aspx?

View 6 Replies View Related

Unique Database For Various Applications?

Oct 18, 2007

There is a possibility of a unique database for various applications. Example users of a table that has the name, email, registro.Uma application included in a user table and other application also included in this table.

View 2 Replies View Related

Do We Need Extra Server To Run Web Applications?

Feb 5, 2002

Our company wants to run web based application
in folowing way.

Browser --> WebServer -->Sql Server

Sql server is part part of corporation domain and has about 25 more databases

Should we dedicate extra SQL server to run Web apps , or it would be safe to run web apps on corporation Sql Server?
or
If any one can point on links on this subject?.
Thank you

View 1 Replies View Related

Correct Way To Move Applications

Dec 10, 2007

What is the correct way to move applications from one server (2000) to another server(SQL 2005). I have to move all the databases as well as applications from one server to another.Here is my procedure:
1) Backup all 65 databases in first server(600GB total)
2)copy all the backup files from one server to another(destination)
3)Make all database(single user)and take transaction Log backup
4) Restore all database to destination server in norecovery mode and restore all transaction log in Recovery mode)
5)stop server 1 and point the application to another server

So how much downtime i have to face since it is 24/7 production server. and
Can you please give the correct details so i can apply.

View 10 Replies View Related

SQL Server Backup Applications

Jul 23, 2005

Hi All,During the past couple of years I have been maintaining the company'sAccess databases, in the coming weeks I will be migrating data to SQLserver, I will be using the Access forms as a frontend to access datawhile we developed a new front end through VB.Net.I was wondering if anyone will recommend an application that makes anexact replica or backup of the SQL server in the case the SQL serverfails. With MS Access, if a record is corrupted we needed to go backto the previous day backup of the database, we cant afford to havethis issue any longer.Regards,John

View 3 Replies View Related

Monitoring Applications Querys

Feb 1, 2007

Hi there!I'm programming in delphi and new to querieng MS SQL Server. Is there a wayto monitor the queries sent to the server and something of the returns. Atleast execution time would be interesting ...Thx in advance,Fritz

View 2 Replies View Related

Looking For Tools To Monitor Sql And Applications

Jul 20, 2005

I am looking for the right tools to do application monitoring.I'm hoping to find one single tool that can do the entire job but ifit does not exist then a few monitoring apps would do as well.I need the ability to do the standard things like testing for ping,checking for windows services running and restarting them after somethreshold is met, and wmi.Some of the more tricky things I need it to do are:* Parse log files looking for specific error codes, and the ability toset an alert only if it sees that error X times over some period oftime.* Run custom slq queries like row counts and max values returned froma query and if that condition is met X times over some period oftime.* Run an external app that does its own custom testing and act on itsresults, which could be to parse the result file from the app.Keep in mind cost is not the isssue right now - so this can befreeware to some type of enterprise solution that our company can use.Does anyone know of any tools that you can point me towards?Thanks...

View 1 Replies View Related

Problem Conecting To The Same DB From Two Applications

Apr 7, 2006

Hello,

I'm new to VB and SQL server. I have a windows forms application and a Web application that need to connect to the same database (Named WebCenter). But when I try to connect to it from the Web app while running the windows forms app this error message apears:

Unable to open the physical file "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataWebCenter_Data.MDF". Operating system error 32: "32(The process has no access to the file because is being used by another process).
Unable to open the physical file "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataWebCenter_Log.LDF". Operating system error 32: "32(The process has no access to the file because is being used by another process.)".
Cannot open database "WebCenter" requested by the login. The login failed.
Login failed for user 'CARLOS-PCASPNET'.
File activation failure. The physical file name "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataWebCenter_Log.LDF" may be incorrect.

Can anyone give me hand or point me in the right direction.

Thanks,

Carlos.

Pd. Please excuse my english.

View 9 Replies View Related

Improving Chatty Applications

Nov 4, 2006

All:

I am presently tasked with improving the performance of a chatty application. What I mean by a chatty application is that the application makes multiple calls to the database server for each user request. In many cases it appears that many of the windows are making multiple calls to the database for the population of dialog boxes. In a couple of cases there are more than 10 dialog boxes that are populated similar to this.

To me this is kind of an "old issue", but my response is (1) cache the dialog information as much as possible and (2) make one call to the database to return all of this data for the dialog boxes if it is not cached. For update calls again make a single call to the database rather than making a call for each individual row of a table that is updated.

I admit that some of this will complicate the code of the application; however, my perspective is that I am supposed to look at this from the database perspective and not from the perspective of "programmer convenience." There will be times in which something that would otherwise get to hairy for a programmer will dictate an additional trip to the server, but this should not normally be the case.

What else do I need to consider?




Dave

View 3 Replies View Related

Using SSRS In Mobile Applications

Apr 3, 2007

Hi All,

Will anybody tell me is there any way to use SSRS Reports in Mobile Applications and if yes how should I implement it in my mobile application.





Regards

Pankaj Parashar

View 1 Replies View Related

Deploying Dual Use Applications With SMO

Feb 20, 2008

I have created a C# Windows Forms application that can be run connected directly to SQL Server 2005 (publisher) for in-office users and to a SQL Express (subscriber) on a tablet PC for remote users. The server is set through configuration and the remote users sync using replication and it all works.

The issue I'm having is that I've found it necessary to install SQL Server management objects (SQLServer2005_XMO) on the clients who sit at desktops and never use replication or SMO. I believe this is because SMO has to be installed in the GAC and I can't just distribute the required dlls with my app.

Is there any way I can deploy this app to always connected users without installing SMO on their machines?

Thanks, Jamie Ide

View 1 Replies View Related

SQL Express And Windows Applications

Apr 26, 2006

I have a windows application that uses a small MySql as its data source. I would like to convert it to SQL Express. I would like to continue to manage the data from the windows application, but would like to make it available to the web using Visual Web Developement. I can create the new database in VWD, but how do I access the data from my application? I can use either ODBC or ADO.

View 1 Replies View Related

Microsoft SQL 2005 Licensing && ASP.NET Applications

Jul 3, 2006

I am having a nightmare getting an answer about what type of licensing I will need for the standard addition of SQL Server 2005 for my asp.net application and wonder if anyone has any advice.
As I see it its very simple, I have a web app that makes a connection to SQL via a connection string using a single username and password, no impersonation just straight SQL authentication.
For this simple scenario I figured I would need to get a SQL 2005 license and then 1 Client access license (CAL), this being a nice affordable way of doing things BUT I am being told by different sources, that I may need to license on a per processor basis as any user of my web application, anonymous or otherwise needs a client access license and given that I don’t know how many users are going to access my website I would need to go for the larger outlay and purchase two standard processor license (my sql server is a dual processor machine).
Can anyone tell me if this is the case, is a connection from a ASP.Net website to a SQL server for my website visitors regarded as a new client and therefore needs a client access license or the large investment of a per processor license?
I would stick with SQL Express but at 4gigs max it won’t do the job.
Thanks in advance.

View 17 Replies View Related

Need Suggestion Or Comments For N-Tier Applications.

Nov 30, 2006

 using System;

namespace BaResearch.Data.msSql
{
interface ISqlDataObject
{
System.Data.SqlClient.SqlConnection Connection { get; }
string ConnectionString { get; set; }
}
}

 ___________________________________using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace BaResearch.Data.msSql
{

public class SqlDataObject : ISqlDataObject
{

private string _ConnectionString;

public SqlConnection Connection
{
get { return new SqlConnection(_ConnectionString); }
}

public string ConnectionString
{
get
{
return _ConnectionString;
}
set
{
_ConnectionString = value;
}
}

}

}

 __________________________________using System;

namespace BaResearch.Data
{
interface IBid
{
string Client { get; set; }
string Contact { get; set; }
string Sponsor { get; set; }
string Priority { get; set; }
string BidStatus { get; set; }
}
}

 _____________________________________________using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace BaResearch.Data.msSql
{

public class Bid : SqlDataObject, IBid
{

#region private member & variables

private int _BidID;
private string _DateCreated;
private string _CreatedBy;

private string _Client;
private string _Contact;
private string _Sponsor;
private string _Priority;
private string _BidStatus;

private SqlDataAdapter sqlda = new SqlDataAdapter();
private SqlCommand _command;
private SqlParameter[] _parameters =
{
new SqlParameter("@client",SqlDbType.NVarChar),
new SqlParameter("@contact",SqlDbType.NVarChar),
new SqlParameter("@sponsor",SqlDbType.NVarChar),
new SqlParameter("@priority",SqlDbType.NVarChar),
new SqlParameter("@bidstatus",SqlDbType.NVarChar),
};

#endregion

#region public member variables - stored procedures

//private string sp_Create = "bids_sp_insert";
//private string sp_Update_ByID = "bids_sp_updatebyid";
//private string sp_Delete_ByID = "bids_sp_deletebyid";
//private string sp_Select_All = "bids_sp_selectall";
//private string sp_Select_ByID = "bids_sp_selectbyid";
//private string sp_Select_ByValue = "bids_sp_selectbyvalue";

#endregion

#region constructors and destructors

public Bid()
{
if (this.ConnectionString == null)
{
this.ConnectionString = ConfigurationManager.ConnectionStrings["SQL.ConnectionString"].ConnectionString;
}
else
{
new Bid(this.ConnectionString);
}
}

public Bid(string ConnectionString)
{
this.ConnectionString = ConnectionString;
}

#endregion

#region methods & events

/// <summary>
/// Attach parameters to an SqlCommand
/// </summary>
/// <param name="sqlcmd">SqlCommand</param>
private void attachparameters(SqlCommand sqlcmd)
{
sqlcmd.Parameters.Clear();
foreach (SqlParameter param in _parameters)
{
sqlcmd.Parameters.Add(param);
}
}

/// <summary>
/// Assign value to the parameters
/// </summary>
/// <param name="sqlcmd">SqlCommand</param>
/// <param name="value">Client object</param>
private void assignparametervalues(SqlCommand sqlcmd, Bid value)
{
this.attachparameters(sqlcmd);
// todo: assign parameter values here
sqlcmd.Parameters[0].Value = value.Client;
sqlcmd.Parameters[1].Value = value.Contact;
sqlcmd.Parameters[2].Value = value.Sponsor;
sqlcmd.Parameters[3].Value = value.Priority;
sqlcmd.Parameters[4].Value = value.BidStatus;
}

public virtual void Create(Bid value)
{
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"INSERT INTO bids (client, contact, sponsor, priority, bidstatus, createdby)
VALUES (@client, @contact, @sponsor, @priority, @bidstatus, @createdby);";
_command.CommandType = CommandType.Text;

try
{
sqlda.InsertCommand = _command;
this.assignparametervalues(sqlda.InsertCommand, value);
sqlda.InsertCommand.Parameters.AddWithValue("@createdby", value.CreatedBy);
sqlda.InsertCommand.Parameters.Add("@bidid", SqlDbType.Int);
sqlda.InsertCommand.Parameters["@bidid"].Direction = ParameterDirection.ReturnValue;
sqlda.InsertCommand.Connection.Open();
sqlda.InsertCommand.ExecuteNonQuery();
sqlda.InsertCommand.Connection.Close();
sqlda.InsertCommand.Connection.Dispose();
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}

public virtual int Update(Bid value)
{
int result;

_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"UPDATE bids SET client=@client, contact=@contact, sponsor=@sponsor,
priority=@priority, bidstatus=@bidstatus
WHERE bidid=@bidid";
_command.CommandType = CommandType.Text;

try
{
sqlda.UpdateCommand = _command;
using (SqlCommand _cmd = sqlda.UpdateCommand)
{
this.assignparametervalues(_cmd, value);
_cmd.Parameters.AddWithValue("@bidid", value.BidID);
_cmd.Connection.Open();
result = _cmd.ExecuteNonQuery();
_cmd.Connection.Close();
_cmd.Connection.Dispose();
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}

return result;
}

public virtual void Delete(Bid value)
{
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"DELETE bids WHERE bidid=@bidid;";
_command.CommandType = CommandType.Text;

try
{
sqlda.DeleteCommand = _command;
using (SqlCommand _cmd = sqlda.DeleteCommand)
{
_cmd.Parameters.AddWithValue("@bidid", value.BidID);
_cmd.Connection.Open();
_cmd.ExecuteNonQuery();
_cmd.Connection.Close();
_cmd.Connection.Dispose();
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}

public virtual DataSet List(string filter)
{
DataSet result = new DataSet();

_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"SELECT * FROM bids_view_listall
WHERE (clientname like @value) or (contactname like @value)
or (sponsor like @value) ORDER BY datecreated DESC";
_command.CommandType = CommandType.Text;

try
{
if (filter != null)
{
filter = filter.Replace(" ", "%");
}
sqlda.SelectCommand = _command;
sqlda.SelectCommand.Parameters.AddWithValue("@value", "%" + filter + "%");
sqlda.Fill(result);
}
catch (Exception e)
{
throw new Exception(e.Message);
}

return (DataSet)result;
}

#endregion

#region IBid Members

public string Client
{
get
{
return _Client;
}
set
{
_Client = value;
}
}

public string Contact
{
get
{
return _Contact;
}
set
{
_Contact = value;
}
}

public string Sponsor
{
get
{
return _Sponsor;
}
set
{
_Sponsor = value;
}
}

public string Priority
{
get
{
return _Priority;
}
set
{
_Priority = value;
}
}

public string BidStatus
{
get
{
return _BidStatus;
}
set
{
_BidStatus = value;
}
}

#endregion

#region Properties

public int BidID
{
get
{ return _BidID; }
set
{ _BidID = value; }
}

public string DateCreated
{
get
{
return _DateCreated;
}
set
{
_DateCreated = value;
}
}

public string CreatedBy
{
get
{
return _CreatedBy;
}
set
{
_CreatedBy = value;
}
}

#endregion

}

}

 _____________________________________________
 
Am I on a right path? I will greatly appreciate in any comments or suggestions for a design. I am creating an n-tier application and i don't know if my design is right. I dont have the proper schooling for creating this kind of applications and I am still on layer of data access and business logic.

View 5 Replies View Related

Sharing A SQL Express Database Between Applications

Feb 7, 2007

Hi;
I have an ASP.NET application with a SQL Express database.Here is the connection string used on the web application:"Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|admindata.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"
Now, i create a Windows application which will run on the server to perform some scheduled tasks, for the Windows application I used this connection string:"Data Source=.SQLEXPRESS;AttachDbFilename=D:WebSitesmywebsite.comwwwApp_Dataadmindata.mdf;Integrated Security=True;User Instance=True"The problem is, when the web site is running and using the database, the windows application can't connect to the database and i don't know where i'm doing wrong, if it's the web application connection string or, if it's the windows application connection string.
I hope someone had the same experience and can point me to a direction.
Thank you;Emerson Brito
 

View 7 Replies View Related

Is Sql Server Express Edition Enough For My Web-applications?

Apr 28, 2008

Good morning,After long hours of search on the subject, I could not find a clear answer to my question.I understand what are ths physical limit fo the express version (1Gb or Ram, 4Gb database, 64 bit WOW).My configuration is as follow, windows webserver 64bit, I have 4 database of 10Mb each for 4 web-application. The maximum concurent connection  is a total fo about 8 for all the web-application together.Therefore due to the cost of buying a workgroup of standard license, I was hoping to be able to  use the express edition.Please let me know your thought.ThanksArno

View 6 Replies View Related

Should I Use SQL Reporting Services For Commercial Applications Now?

Apr 20, 2004

Thanks,

View 1 Replies View Related

Connection String For Selling Web Applications?

Jan 5, 2005

If I'm wanting to sell my Web Applications to clients that run using SQL Server, is it best to use a UserID and Password in the connection string, or would using Windows Integrated Security (SSPI) do? The reason I'm wondering is because I wouldn't know my customer's UserID and Password when they purchased one of my web apps, I would have to recompile the app with the new connection string (I'm not storing it in the web.config file)..

What is the best way to handle this on a global level, so that it would work on any system?

for example, would having the following connection string be a good idea for a production site?

string strMyConnectionString = " Data Source = (local); Integrated Security = SSPI; Initital Catalog = MyDBSource; ";

View 4 Replies View Related

Background Services Or Applications Setting?

Mar 14, 2003

On Win2000 server running SQL 2000 Enterprise edition, should the advanced setting on performance options for Win2000 be set for running background services or applications?

View 3 Replies View Related

How To Connect Two Applications To One Table In Java

Aug 25, 2013

I am working on a hospital application using java programming language, i need to know how to connect two applications to one table over a network where the data read by application one can not be read by application 2 and vise versa...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved