|
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.
|
|
|
|
|
Hi All,
I have a problem with my SQL Server 2000, it seems that when 50 users where using my application at some point of time the cpu utilization of sqlserver goes to 100% and it comes down after some time. it happens at regular intervals.
Any help plz. Thankz in advance...............
Bala
-- modified at 11:41 Saturday 13th October, 2007
|
|
|
|
|
Hi All,
I havnt got any response from CodeProject, but I have solved the issue myself. I tried creating Clustered And Non-Clustered Index into a table (Important table that appears in most transactions).
Also i have created some Maintenance paln that executes DBCC commands automatically.
Bala
|
|
|
|
|
hi,
i have a very simple problem....i have a ms access database. I have a windows form, which has two textboxes(name and depid) and a combobox(department),i want to write a query that will search all these using WHERE and LIKE.ie i need to create a function by the name search and use the query so that this will search all these...i am new to sql...expecting your help
Thanks in advance,
JAN
|
|
|
|
|
select * from <tableName> where name ='deptname' and depid='1' <br />
-- instead value 1 on depid set another id
for more help describe your problem much more.
I Love SQL
|
|
|
|
|
hi,
i have three layers.
1)form.cs
2)datalayer
3)database(forget about this since it is used to open and close the connections form the ms access)
i have two text and a single combobox.
basic idea is i want a query that will search even if any one of these fields are selected.
also do the same if two are selected.
also do the same if one is selected.
the code to search will have to be on my btn click for serach event(ie is in layer form1.cs).
it will have to call my query that will be in a fn: that is in datalayer ( public DataTable refinesearch(string searchstr1, string s2, string s3)
so i think i need to use "like" condition.
something like
"select * from Employee(name of the table) where name like "string" where empid like "s2" etc........
this is my problem .i do not know the query.
thanking you and expecting your reply....
J
|
|
|
|