I get an error when I try to execute the following code using ADO.Net
in VB.Net:
conn.open
sqlString="CREA TE LOGIN test WITH PASSWORD = '1qaz2wsx'"
command=new SqlCommand(sqlS tring)
command.connect ion = conn
command.Execute NonQuery()
The error occurs when executing the ExecuteNonQuery line and is:
"Line1: Incorrect syntax near 'LOGIN' "
The database connection is connected to the master database of SQL 2005
Express using the sa account. This line executes just fine in Sql
Server Studio Manger when connected as sa. Am I not allowed to create
database logins via ado.net?!?! I need to for my application.
Thx,
Marcus 3 1713
Dear Holysmokes99,
Suppose it should work, the syntax and codes are all correct.
Would you show us the Connection string?
--
Hope this help and welcome to reply the testing result.
Regards
Ken Lin, Kam Hung
Founder and VP of Hong Kong .NET User Group( http://HKNetUG.com)
MCP, MCP+I, MCDST, MCSA, MCSE(NT4 & win2k),
MCSE+I, MCDBA(SQL7 & SQL2K), MCSD(VB6 & .NET), MCAD(.NET)
Microsoft Community Star(Hong Kong & Taiwan)
Microsoft Most Valuable Professional(.N ET since 2003)
MCT2004 & 2005
"holysmokes 99" <ho**********@h otmail.com> wrote in message
news:11******** **************@ z34g2000cwc.goo glegroups.com.. . I get an error when I try to execute the following code using ADO.Net in VB.Net:
conn.open sqlString="CREA TE LOGIN test WITH PASSWORD = '1qaz2wsx'" command=new SqlCommand(sqlS tring) command.connect ion = conn command.Execute NonQuery()
The error occurs when executing the ExecuteNonQuery line and is:
"Line1: Incorrect syntax near 'LOGIN' "
The database connection is connected to the master database of SQL 2005 Express using the sa account. This line executes just fine in Sql Server Studio Manger when connected as sa. Am I not allowed to create database logins via ado.net?!?! I need to for my application.
Thx, Marcus
Hi, KenLin
The connection string is "server=mar cus; Initial Catalog=master;
uid=sa;password =whatever!". I am able to connect fine to the database
using this ADO.Net connection as I have just prior to the CREATE LOGIN
command executed several other standard queries on the server.
Cheers,
Marcus
Oh, Jeesh, My bad!!! I was connecting to an
instance of SQL Server 2000, and not SQL Express. I have both on my
machine
and forgot to reference it as "Marcus\SQLEXPR ESS", instead using
"Marcus" only. CREATE LOGIN is new for SQL Server 2005 and thus I got a
syntax error when connecting to SQL 2000. Sorry about that!
Marcus This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Marina Anufreichik |
last post by:
Hi,
After deploymnet web application on web server I can access page on local
machine and login fine but when I'm trying to access web site from remote
machine I can see login page, but when I'm trying to login with correct
credentials it give me error:
Server Error in '/PDVMgr' Application.
----------------------------------------------------------------------------
|
by: John Lau |
last post by:
Hi,
I am looking at the MS KB Article 306355: HOW TO: Create Custom Error
Reporting Pages in ASP.NET by Using Visual C# .NET
This article describes how to redirect errors to a custom html error page.
All six steps in the article work just fine. Then at the end of the
article, there is a little comment about redirecting errors to an aspx page
(instead of an html page):
|
by: Edward Mitchell |
last post by:
I have a problem that involves the error I receive when attempting to
complete the asp.net web application example (Walkthrough: Creating a Web
Application Using a Third-Party Business Object). When I first create the
SQL connection in VS.NET 2003, I test the connection and everything works
fine. However, when I attempt to run the first stage of the app (the bound
datagrid), I receive an error stating:
login failed for user...
|
by: arsisthesis |
last post by:
Hi all,
I have a curious problem with the ERROR 1044 and 1045:
-system: OS X 10.4.3 (bash shell)
-bash schell prompt: /~ kssun$
-I have set passwd to 'kssun'
-I set path: PATH=${PATH}:/usr/local/mysql/bin
- symptom 1
|
by: ruju00 |
last post by:
I am getting an error in Login() method of the following class
FtpConnection
public class FtpConnection
{
public class FtpException : Exception
{
public FtpException(string message) : base(message){}
public FtpException(string message, Exception innerException) :
base(message,innerException){}
| |
by: Ted |
last post by:
In WSAT, I get the following error when trying to set up my provider:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to
create and configure the database, and then return to this tool to set
the provider.
On Windows XP Pro, I am using MS Visual Studio 2005, and I am using
the developer's edition of...
|
by: Raj |
last post by:
I have developed a component create database, sql login,pwd, create tables
etc.,
The component is working fine with VB
But the same is not working with ASP as I get this error: Error 800a01a8
For creating database, sql login,pwd I am using sa with a valid password.
Please advice.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |