Multi-user Access Through A Data-access Layer/remoting Server
Oct 30, 2007
Hi guys,
I've been developing desktop client-server and web apps and have used Access and SQL Server Standard most of the time.
I'm looking into using SQL CE, and had a few questions that I can't seem to get a clear picture on:
- The documentation for CE says that it supports 256 simultaneous connections and offers the Isolation levels, Transactions, Locking, etc with a 4GB DB. But most people say that CE is strictly a single-user DB and should not be used as a DB Server.
Could CE be extended for use as a multi-user DB Server by creating a custom server such as a .NET Remoting Server hosted through a Windows Service (or any other custom host) on a machine whereby the CE DB would run in-process with this server on the machine which would then be accessed by multiple users from multiple machines??
Clients PCs -> Server PC hosting Remoting Service -> ADO.NET -> SQL CE
- and further more can we use Enterprise Services (Serviced Components) to connect to SQL CE and further extend this model to offer a pure high-quality DB Server?
Clients PCs -> Server PC hosting Remoting Service -> Enterprise Services -> ADO.NET -> SQL CE
Seems quite doable to me, but I may be wrong..please let me know either ways
Thanks,
CP
View 3 Replies
ADVERTISEMENT
May 3, 2007
How can I access data to SQL server 2005 using Windows form application,ADO.net and .Net remoting?
Can anybody help me? please...
View 5 Replies
View Related
Jun 19, 2007
I've been following Soctt Mitchell's tutorials on Data Access and in Tutorial 1 (Step 5) he suggests using SQL Subqueries in TableAdapters in order to pick up extra information for display using a datasource.
I have two tables for a gallery system I'm building. One called Photographs and one called MS_Photographs which has extra information about certain images. When reading the MS_Photograph data I also want to include a couple of fields from the related Photographs table. Rather than creating a table adapter just to pull this data I wanted to use the existing MS_Photographs adapter with a query such as...1 SELECT CAR_MAKE, CAR_MODEL,
2 (SELECT DATE_TAKEN
3 FROM PHOTOGRAPHS
4 WHERE (PHOTOGRAPH_ID = MS_PHOTOGRAPHS.PHOTOGRAPH_ID)) AS DATE_TAKEN,
5 (SELECT FORMAT
6 FROM PHOTOGRAPHS
7 WHERE (PHOTOGRAPH_ID = MS_PHOTOGRAPHS.PHOTOGRAPH_ID)) AS FORMAT,
8 (SELECT REFERENCE
9 FROM PHOTOGRAPHS
10 WHERE (PHOTOGRAPH_ID = MS_PHOTOGRAPHS.PHOTOGRAPH_ID)) AS REFERENCE,
11 DRIVER1, TEAM, GALLERY_ID, PHOTOGRAPH_ID
12 FROM MS_PHOTOGRAPHS
13 WHERE (GALLERY_ID = @GalleryID)
This works but I wanted to know if there's a way to get all of the fields using one subquery instead of three? I did try it but it gave me errors for everything I could think of.Is using a subquery like above the best way when you want this many fields from a secondary table or should I be using another approach. I'm using classes for the BLL as well and wondered if there's a way to do it at this stage instead?
View 7 Replies
View Related
Mar 10, 2008
Hello, everybody.
In my web application, i'm using 2 tabels; Users(Username(PK), Pwd, Name, Deptid(FK)) n Dept(Deptid(PK), Deptname)).
For creating a Data Access Layer 4 my project, I added dataset as new item n followed the wizard 2 create the required functions.
I have a function GetUser(@uname, @pwd), which takes username n password as input. M using this for authentication purpose.
While executing it poping an ConstrainException.
Plz help me out.
I've tried 2 as clear as possible here. OR u may ask me any other questions for clear picture of the scenario.
Thanks and Regards,
Sankar.
View 1 Replies
View Related
Jun 11, 2008
I request you plz tell how to create Data Access Layer. I mean DataAccess.dll. So that I can call stored procedure from dataaccess.dll as below.
DataAccess.SqlHelper.ExecuteDataset(DataAccess.DSN.Connection("DBConnectionString"), CommandType.StoredProcedure, "SP_GetEmpIds");
I request you how can I add this stored procedures to DataAccess.dll and function. I am not having any idea in this area. I request you plz give me some suggestions to work with task.
View 3 Replies
View Related
Apr 5, 2007
How do I get a System Table like 'Sysobjects' into the Data Access Layer?
My app generates tables on the fly, and has to check in the sysobjects table which tables are present.
View 5 Replies
View Related
Jan 10, 2008
Hi Experts ! I want to use maximum feature of SQL
Server 2005 and ASP.Net 2.0 in making Data Access LayerSuggestions will be welcomed .Thank you
RegardsKAMRAN
View 3 Replies
View Related
Feb 20, 2008
I've a management module (managing Products) currently being displayed on the aspx page using ObjectDataSource and GridView control.The datasource is taken from a class residing in my Data Access layer with custom methods such as getProducts() and deleteProduct(int productID)I'm currently using SqlDataAdapter as well as Datasets to manipulate the data and have no big problems so far.However, my issue is this, each time i delete a product using the deleteProduct method, I would need to refill the dataset to fill the dataset before i can proceed to delete the product. But since I already filled the dataset using the getProducts() method, is it possible to just use that dataset again so that I dont have to make it refill again? I need to know this cos my data might be alot in the future and refilling the dataset might slow down the performance. 1 public int deleteCompany(Object companyId)
2 {
3 SqlCommand deleteCommand = new SqlCommand("DELETE FROM pg_Company WHERE CompanyId = @companyId", getSqlConnection());
4
5 SqlParameter p1 = new SqlParameter("@companyId", SqlDbType.UniqueIdentifier);
6 p1.Value = (Guid)companyId;
7 p1.Direction = ParameterDirection.Input;
8
9 deleteCommand.Parameters.Add(p1);
10 dataAdapter.DeleteCommand = deleteCommand;
11
12 companyDS = getCompanies(); // <--- I need to refill this before I can delete, I would be iterating an empty ds.
13
14 try
15 {
16 foreach (DataRow row in companyDS.Tables["pg_Company"].Select(@"companyId = '" + companyId + "'"))
17 {
18 row.Delete();
19 }
20 return dataAdapter.Update(companyDS.Tables["pg_Company"]);
21 }
22 catch
23 {
24 return 0;
25 }
26 finally { }
27 }
I thank you in advance for any help here.
View 3 Replies
View Related
Jul 9, 2007
Hi,
I am having a application in which from the front end i am saving details of three different things
i.Enquiry Details
ii.Parts Details
iii.Machine details
i am saving the Enquiry detail in a data table,Parts Details in a data table and machine detail in a data table and finally i am adding the three data tables into a single data set and passing the data set to data access layer there i have three insert command one for each data table in my case the enquiry data table will be saved first and then the next two details will be saved and i am saving the details in three different tables in the database, my problem is some times the enquiry details will save to the database and while saving the Parts details there may be some exception and i will throw an exception in that case the enquiry details will be saved and the remaining two details are not saved(Which are also part of the same Transaction).I wanted to know about how to call the transaction function in case of Data Access Layer.
View 4 Replies
View Related
Sep 27, 2007
in the class library i written the code name :customer is the lib name
using System;
using System.Collections.Generic;
using System.Text;
namespace Customer
{ class Entites
{
public int inTest;
public int inTest2;
}
}
Now in the Class1.cs i written the code
i am getting the data from the database by using enterprise lib 2006 connection function
now HOW TO BIND THE DATA TO LIST AND RETURN TYPE IS LIST
PLEASE CHECK THE CODE AND REDEFINE THE CODE
using System;
using System.Data ;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using System.Collections;
using System.Xml.Serialization;
using System.Data.Common;
using Customer;
namespace Customer
{
class Class1
{
public List<Entites> getdata(int id)
{
Database db = DatabaseFactory.CreateDatabase("mycon");
System.Data.Common.DbCommand cmd ;
cmd = db.GetStoredProcCommand("GET_CUSTOMER");
cmd.CommandType = CommandType.StoredProcedure;
db.AddInParameter(cmd,"@CID",System.Data.DbType.Int32,id);
List<Entites> objEntites = new List<Entites>();
using (IDataReader dr = db.ExecuteReader(cmd))
foreach (Entites obj in dr)
{
objEntites.inTest = obj.inTest;-----------------------------------------------ERROR LINE
// objEntites.Add(obj);
}
return objEntites;
}
}
}
Error 2 foreach statement cannot operate on variables of type 'System.Data.IDataReader' because 'System.Data.IDataReader' does not contain a public definition for 'GetEnumerator' D:KOTI_PRJSEnterpriseCustomerClass1.cs 34 13 Customer
View 1 Replies
View Related
Sep 20, 2006
I am taking my first stab at a 3 tier architecture within ASP.Net. I have been adding datasets and creating a new Insert to add certain parts to a table. I am trying to add a date field called 'DateAdded' and is setup in SQL as a DateTime. When Visual Studio auto created the dataset, the Insert function is not "DateAdded as Datetime" as I would have expected, but it is "DateAdded as System.Nullable(Of Date)". There is a space in between 'Of' and 'Date'. If I keep the space in there the insert function shows an error that says "Arguement not specified for parameter DateAdded of funtion( etc. etc.). If I take the space out, the error on the insert function goes away but there is an error within the "OfDate" that says "Array bound cannot appear in type specifiers". I am confused on why the date format changed and how I can get a date to go into the database using the autogenerated datasets from Visual Studio. Any help would be appreciated. Thanks, Mike
View 1 Replies
View Related
Nov 1, 2006
HiI'm having problems following the tutorial on creating a data access layer - http://www.asp.net/learn/dataaccess/tutorial01cs.aspx?tabid=63 - when I try to compile in Visual Studio 2005 I get namespace could not be found. I followed exactly the tutorial - I created a dataset and added this code in my aspx page. <asp:GridView ID="GridView1" runat="server" CssClass="DataWebControlStyle"> <HeaderStyle CssClass="HeaderStyle" /> <AlternatingRowStyle CssClass="AlternatingRowStyle" />In my C# file I added these lines... using NorthwindTableAdapters; <<<<<this is the problem - where does this come from? protected void Page_Load(object sender, EventArgs e) { ProductsTableAdapter productsAdapter = new ProductsTableAdapter(); GridView1.DataSource = productsAdapter.GetProducts(); GridView1.DataBind(); }Thanks in advance
View 6 Replies
View Related
May 19, 2008
Hello,
My datalayer of C# code is invoking a stored procedure that returns a varchar(max) SQL data type. In my ASP.NET code, I have:
SqlCommand myCommand = new SqlCommand("usp_GetTestString", myConnection);
myCommand.Parameters.Add(new SqlParameter("@TestString", SqlDbType.Text));
myCommand.Parameters["@TestString"].Direction = ParameterDirection.Output;
myConnection.Open();
myCommand.ExecuteNonQuery();
return Convert.ToString(myCommand.Parameters["@TestString"].Value);
The query fails to execute and returns an error: String[1]: the Size property has an invalid size of 0. If I change the SqlDbType.Text parameter type to SqlDBType.Varchar, 100 (or any other fixed varchar length), it works but limits the length my unlimited field text. Any suggestions on how I can use db type text or varchar(max)? The field I need to retrieve is string characters of unlimited length and
hence the datatype varchar(max).
View 3 Replies
View Related
Oct 25, 2006
I have developed two programs that operates against the same database. One of the program is just a display program that displayes the data put into the other administation program where you put in the data to be displayed (an administration program).
Every time I access the db from the administration program, the display program stops and throws connection pool errors and other database errors. For me, it looks like it does´t do multi-access to a database.
I have tried putting user instance to off in both programs, but this didn´t help.
Connection string also points to same file database.
View 6 Replies
View Related
Sep 11, 2007
Please help....
I have designed an application that uses sql server 2005 express database. This application was intended to be installed and used on a local desktop machine. However, now this application needs to be also installed on several computers and still needs to use only 1 database. Part of the database saves local user settings, so what I have done thus far is use two connection strings: one for local database (because the application may be used as origionally intended) and one for remote database that everyone should be able to connect to.
When I remotely connect to the database, it works fine. However, it seems to be locked so when I chose the same database for another user I get the error message "This File Is In Use." I need to know how to unlock it and make it usable for several users at the same time.
Thank you for your help! Please let me know if you need more information or if something is unclear in my description.
View 6 Replies
View Related
Feb 10, 2007
Of all the Visual Basic.NET data access books that I have purchased and all the Internet site example code that I have reviewed, none have had any good examples of multi-threaded VB.NET code doing data access.
I am trying to avoid the non-responsiveness in a VB app while a simple data retrieval from SQL Server 2005 is in progress.
If anyone knows of any book titles or web sites that have example code (good or not) of multi-threaded VB.NET applications doing data access against Microsoft SQL Server (7, 2000, or 2005) or even against Microsoft Access(TM), it would be very much appreciated if you could provide the book title or URL to point me in the right direction.
The more examples the better.
Thanks in advance.
View 5 Replies
View Related
Apr 8, 2007
Before page 12, step by step instructions work!
Then there is code for AllProducts.aspx that doesn't work if one inserts the code
into the DataTutorial project started on page 1. Yes I changed the name of the CodeFile!
The code given for AllProducts.aspx.cs doesn't compile.
I was doing better without the tutorial!
I can gleen out some concepts but that is all.
If that is all, why have a tutorial?
View 3 Replies
View Related
Sep 20, 2006
I am in the process of migrating 40 access databases to SQL Server and still use an access front end.All of these databases are Identical in structure and purpose. The goal is to centralize all of the databases backends into one Sql server database, but the data needs to
stay seperated by each location(user). I was able to add a location feild to all of the tables to keep the data seperate. Then I imported three of the locations data for testing. I would like to know how could I filter the data on the access frontend, so that it would ask the user for their location and only allow the user to access, update, and delete that Locations data ?
View 4 Replies
View Related
Mar 21, 2014
I have a windows 2008 with SQL Server 2008 R2 VM on Azure. I am trying to connect to the SQL server for the first time using SSMS, but have not been able it. I have a VPN tunnel, so I am connecting using Windows authentication. The error I get back from SSMS is:
Login failed for user 'domainusername'. (Microsoft SQL Server, Error: 18456).In the event viewer I see this error message: Login failed for user 'domainusername'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: <local machine>]
I have done the following:
- created an endpoint for port 1433
- opened port 1433 in the firewall
- Ran the MSSQLSERVER service as the build-in users Network Services, Local System, and Local Service, and as a local and domain administrator, with the same exact result each time.
- I get the same result trying to connect locally or remotely.
- I get the same result trying to connect using sqlcmd.
View 4 Replies
View Related
Jun 10, 2015
I have recently upgraded to SQL2014 on Win2012. The Access front end program works fine.
But, previously created Excel reports with built in MS Queries now fail with the above error for users with MS 2013. The queries still work for users still using MS 2007.Â
I also cannot create any new queries and get the same error message. If I log on as myself on the domain to another PC with 2007 installed it works fine, so I don't think it is anything to do with AD groups or permissions.
View 6 Replies
View Related
Jun 17, 2007
Hello,I am working on an Access VBA application, working in client/servermode, with a shared SQL Server base.I have to INSERT some data in the base, and the know what is the IDthat SQL Server associated with my data in the table. So I need to dothe followingINSERT data INTO TABLESELECT MAX ID FROM TABLE (to get the ID)but since I am working in client/server, if some DATA has been insertedby another client after my INSERT, then MAX ID is not the convenientID of my data ...Is there a way for me to get the ID when I do the INSERT, or tolock/unlock the table before the INSERT and after the SELECT ?Thank you for any hint about that.--L'ordinateur peut faire plus de calculs que le cerveau de l'homme caril n'a que ça à faire
View 1 Replies
View Related
Apr 22, 2015
When i am trying to start our hospital software based on SQL server 2000, it shows Following Error.Search Condition is not valid, (DBNETLIB) Connection Open (connect()).  SQL server does not exist or excess denied. Due to Fetch data.I run our software in Windows 8.1, while it smothly runs in previous version of Windows XP and 7.
View 2 Replies
View Related
Mar 25, 2008
I need to determine the following about the current authenticated Windows domain user who is trying to access a SQL Server via a trusted connection.
1 Has the current user been granted login access to the trusted SQL Server?
2 Has the current user been granted access to a specific database?
3 Is the current user a member of a specific database role such as (DB_ROLE_ADMINISTRATORS)?
Thanks,
Sean
View 6 Replies
View Related
Sep 10, 2015
Is there any way to get more information for when IAuthorizationExtension::CheckAccess fails to grant access to a report item for the current user? Specifically, it would be useful to know:
1. URL of attempted report
2. IP address of user agent
3. Identity of current user
4. Date/Time of the failed attempt
ssrs2014
View 7 Replies
View Related
Dec 6, 2013
I would like to know if there is a way to find out who changed a users roles/access WITHOUT using the audit function. For example, if a user account was created and given SA access then changed to read only, how can I find out who made that change? I tried searching for an answer, but kept getting no results. I'm thinking this may tie into the sys.sysusers view?
View 3 Replies
View Related
Jul 13, 2015
I'm using a legacy application built using VB5 and SQL Server 7. After recompiling it, and putting the database in SQL Server 2012. I want to access the current login user using the SQL function SUSER_SNAME().
This is the code.
Set rdoRes = goDatabase.Connection.OpenResultset("select suser_sname()")
But I'm unable to get the current user login in the application. If I write any other SQL statement instead of this, then it runs. But only this statement is not running. Is there any security reasons for this?
View 8 Replies
View Related
Mar 3, 2008
When creating a user control (ascx) and registering it in the webpage, an error occurred:
"Login failed for user ''. The user is not associated with a trusted SQL Server connection."
This error does not appear when creating data access normally, and I don't use username/password for the northwind database; any suggestions.
View 5 Replies
View Related
Sep 22, 2015
I'm trying to re-write my database to de-couple the interface (MS Access) from the SQL Backend. Â As a result, I'm going to write a number of Stored Procedures to replace the MS Access code. Â My first attempt worked on a small sample, however, trying to move this on to a real table hasn't worked (I've amended the SP and code to try and get it to work on 2 fields, rather than the full 20 plus).It works in SQL Management console (supply a Client ID, it returns all the client details), but does not return anything (recordset closed) when trying to access via VBA code.The Stored procedure is:-
USE [VMSProd]
GO
/****** Object: StoredProcedure [Clients].[vms_Get_Specified_Client] Script Date: 22/09/2015 16:29:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
[code]....
View 4 Replies
View Related
Dec 11, 2006
I created a database that will be distributed to my customers. This database is running on an Instance of SQL Server 2005 Express edition. I removed the admin logins from my SQL Server Instance so in theory, only my application connecting itself using the Sql Server autenthication will be able to be access the data (using "sa" having a password that I set at the installation).
For now, all this is working fine and after some tests, I haven't been able to access the data in any ways except by using the "sa" and the password my app is the only one to know.
But the problem is coming from a security leak when using User Instance. Indeed, I've been able to create a program getting the content from my MDF file. If somebody try to get connected using User Instance on his own SQL Server instance, he will be able to reach the data.
How could I prevent this to happend? Is there a property or something that could be set into the database that would prevent the database (mdf file) to be used with User Instance?
Thanks!
View 5 Replies
View Related
Oct 3, 2006
I'm hoping someone can get me pointed in the right direction
we have SQL 2005 and I need to add a user account to let some only view the data
no edits / adds / deletes ?
can any one help
thanks
David
View 5 Replies
View Related
Jul 28, 2015
How do I grant a user permissions to only one table in a database.  How would it affect him using our Main App which is NAV with regards to his user's permission in NAV
View 2 Replies
View Related
Jun 9, 2015
When i wanna run Application in other computers in network. The following error occurs.
error : System.Data.SqlClient.SqlException: Login failed for user 'Suren-PCGuest'.ConnectionStr = "Data Source=SUREN-PCMSSQLSERVER,1433;Initial Catalog=WorkFlow;Integrated Security=True";
View 5 Replies
View Related
Nov 12, 2015
We need to insert data/rows from a SQL Server 2014 database into MS Access database. The problem is, there are so many columns (100+) in the table and there are so many insert transactions of this kind (from different tables) that it is not very easy to write the code in VB.NET that lists all column names.
Both the Access and SQL Server tables have the same number of columns and the equivalent data types, so inserting is not really the problem. It's just that is there a way to do an insert statement in T-SQL that does not name all the columns?
View 3 Replies
View Related