|
The database exceptions are pretty generic - to work out what's wrong, you'll need to look at the Message property of the exception. Then look that up in your database provider's documentation.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Hi ,
Could some one tell me what are the advantages of sql server 2005 batch jobs,
what are the advantages of a batch job and does they relate to ssis packages ,
any reply would be highly appreciated
|
|
|
|
|
Please define the term 'batch jobs'.
Do you mean SQL Server Agent jobs?
|
|
|
|
|
Hi all ,
I have a .net app working with sql server 2005 and this is a server-based app , I want that my app be run on windows server 2003 and the clients be run on windows xp, and I use Windows authentication mode , because it is more secure , How can I deploy my app to do these?
|
|
|
|
|
Presumably you mean that your client application itself connects directly to the database, there is no server application involved?
If you want to use Windows Authentication, you will need to ensure that Windows can authenticate the users. This means either that the clients and server are all in the same domain (or in the same Active Directory domain tree, forest, or with appropriate inter-forest trusts), or that they have the same usernames and passwords on both client and server (this is a quirk of Windows Authentication coming from workgroup file sharing). If you don't have this, you may well find SQL Server authentication easier. The main problem with that is that the passwords are sent unencrypted in the channel, and so can be observed by someone with a packet sniffer. It also means that the password is typically stored in a configuration file - anyone with access to the file can get the password.
You can solve the first problem by setting up an SSL certificate on the SQL Server and setting the Encrypt property in the connection string to true. That encrypts the entire conversation between client and server.
The second problem can be solved by encrypting the connection string in the file. See for example SectionInformation.ProtectSection in the .NET SDK documentation.
You will then need to set the users up with logins to SQL Server, and map those logins to users in the database. After that, you need to give the users permissions to manipulate the database objects, or make them members of appropriate database roles. The default for a new user is to be a member of the public role which has no permissions to act on anything. You can create a SQL Server login for a Windows security group if you prefer, which simplifies things a lot.
It's hard to do a full treatment of SQL Server security in such a small space. I had a go here[^].
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Thanks for your help , but :
1)this .net app is going to run in a workgroup environment , It is wrong that all of the clients connect to sql server using same Sql server User?Or I should create a user for each client?
2)How can I Install SSL?
|
|
|
|
|
i m unable to insert record in table using OLeDb follwoing command.it is drawing unhandled expection,please do tell me the easiest way
///////////////////////////////////////////////////////////
OleDbConnection m_Connection = new OleDbConnection(Connection);
m_Connection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:use.mdb";
m_Connection.Open();
Connection ="INSERT INTO user =(1,1)";
|
|
|
|
|
3 things:
1. Don't post your questions twice.
2. Your code won't compile. The last line references a variable that hasn't been declared.
3. You should learn basic SQL syntax before attempting anything more complicated. This site[^] should help.
Paul Marfleet
|
|
|
|
|
You should create a command object, not pass the query to the constructor of the connection object.
also the syntax of the SQL statement to insert is not true. It should be something like:
INSERT INTO user values (1,1)
that if the user table has just 2 columns.
I think you really need to read about ADO.NET this can be a good place to start.[^]
|
|
|
|
|
i m unable to insert record in table using OLeDb follwoing command.it is drawing unhandled expection,please do tell me the easiest way
///////////////////////////////////////////////////////////
OleDbConnection m_Connection = new OleDbConnection(Connection);
m_Connection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:use.mdb";
m_Connection.Open();
Connection ="DELETE FROM user WHERE username = @s";
|
|
|
|
|
using System.Data.OleDb;
public class Database
{
OleDbConnection connection = new OleDbConnection();
OleDbCommand command = new OleDbCommand();
public void openConnection()
{
connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\use.mdb";
connection.Open();
}
public void closeConnection()
{
if (connection.State != 0)
{
connection.Close();
}
}
public void executeNonQuery(string query)
{
command.Connection = connection;
command.CommandText = query;
openConnection();
command.ExecuteNonQuery();
closeConnection();
}
}
public class Test
{
Database ObjDatabase = new Database();
string strQuery;
objDatabase.openConnection();
strQuery = "DELETE FROM User";
objDatabase.executeNonQuery(strQuery):
objDatabase.closeConnection();
}
|
|
|
|
|
Hi,
I am programming a database app and have a problem. When the app starts, a typed dataset is filled via the fill method. When the user made its changes and presses the save button, his changes are committed to the database via executing sql-commands (and some other not-db-related stuff) depending on the row-states. This works very good, this users changes are done. But after that the problem starts:
I want rows to be deleted/updated in the dataset which have been deleted/modified by _other_ users in the database. So whats the most elegant way to sync my dataset?
I found the datatable.merge() method, but it does not delete rows which dont exist anymore.
Another possibility is to clear my dataset and fill it newly, but this will lead to the gui-components bound to the dataset to for example jump to the first record etc.. I guess.
Then I found the loadrows() method...anyone used it?!
And finally I could sync completely manually, especially because each row has a timmestamp column.
Tell me your solutions/experiences please.
Thanks
vb
|
|
|
|
|
Hi,
I have installed MSSQL2005 along with MS.NET2005.
How can acces the database and tables in MSSQL 2005.I am new to MSSQL2005.
In my google search, i find one solution ie like
Start | All Programs | Microsoft SQL Server 2005 | SQL Server Management Studio Express.<br />
But unfortunately i cant find this.
Start | All Programs | Microsoft SQL Server 2005
After this ,there is only Configuarion Tool
I am failed to find
SQL Server Management Studio Express.<br />
Am I missing any thing in installation??
Be very grateful for any advice.
Regards
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Seems that you did not install management studio.
Visit http://msdn2.microsoft.com/en-us/express/bb410792.aspx[^] and download "SQL Server Management Studio Express" and install it.
Or download the full package "Server 2005 Express Edition with Advanced Services" and the toolkit.
|
|
|
|
|
Thank you very much.
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Good Day Again,
I am using C# and I only want to add distinct items into my table.
I know there are many ways to do this like:
1. Using select, check if there is any item using the same ID code.
But is there any way to do this with a single command?
Or I need to change something in my TABLE SETTINGS to tell it not to allow non-distinct items?
Regards,
SQL NEWB
|
|
|
|
|
|
Hi Giorgi,
Sorry for not including the dbms. It's Microsoft SQL Server 2005 Express.
Thanks.
|
|
|
|
|
Good Day Sir/Maam,
I am new with installing MS SQL Express Edition.
So I did install MS SQL Server 2005 Express Edition on my home PC. Everything went fine. I have made a program in C# with ADO.NET and everything seems to work fine.
Now, I want to have a username and password when connecting to a data source. How can I do this? I mean, Where is the settings for that?
Thank You.
|
|
|
|
|
See the following site[^] for details on how to create different connection strings. You should use something like this:
Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername; Password=myPassword;
Paul Marfleet
|
|
|
|
|
Thanks for the reply, Paul.
I already know the connection string. What I am inquiring for is how to make my SQL Server run on SQL Authentication with username and password.
Thanks.
|
|
|
|
|
Use the CREATE LOGIN[^] and CREATE USER[^] statements to create a new SQL login and grant it access to a database.
For example:
USE master
GO
-- Create database login
CREATE LOGIN Paul WITH PASSWORD='p@ssw0rd1'
USE myDB
GO
-- Assign login rights to access myDB
CREATE USER Paul FOR LOGIN Paul
You can do the same thing through the Management Studio UI.
Hope this helps.
Paul Marfleet
|
|
|
|
|
Thanks Paul. Solved it. Gave a 5.
|
|
|
|
|
Hi all ,
I created a Login in sql server 2005 and set its permissions and created a user mapped to it , I have a .net app that connects to this database , How should I deploy this database with my .net app that is going to run server-based ? When using Windows Authentication Mode , to which Login should I set permissions? Should I write a script for setting these permissions?
Thanks
|
|
|
|
|
Depends on the version of windows, IIS you use.
For XP+IIS 5.0 you should add a windows login for ASPNET account
for Win2003+IIS 6.0 you should use NETWORK SERVICE user.
You can generate a SQL Script of your database and run it with the installation package to create DB and users.
|
|
|
|