Create Sql Server User?
Jun 17, 2009Create Sql Server User
View 4 RepliesCreate Sql Server User
View 4 RepliesI'm trying to execute CREATE USER with a given username (via sql parameter)
exec sp_executesql N'CREATE USER @LoginName
FOR LOGIN @LoginName;',
N'@LoginName varchar(5)', @LoginName='myuser'
Heres the code thats generating the above:
Dim myCommand As SqlCommand = New SqlCommand("CREATE USER @LoginName
FOR LOGIN @LoginName;",
ClassDatabaseConnection.CustomInstance)
[code].....
I get and error:Incorrect syntax near '@LoginName'.I think this is due to the parameters being passed as VarChar causing 'MyUser' rather than MyUser Can I not do this with sql parameters?
I am creating a multi-user application using VB 2005 Pro and SQL Server 2005.I would like to know what your ideas are when it comes to managing user permissions in regard to being able to view, add, edit and delete information in the database? Do you think I should have the end user type in the information into the VB application which then will create an SQL server user and then apply permissions to that security user or should I fine-grain the application by allowing groups to be created and then assigning permissions and users to those groups?
View 3 RepliesI want to create a page that allows a user to upload a file directly to my ftp server. For some reason when I run the code and try to upload a file I get:
ERROR: Could not find file 'C:Documents and SettingsuserMy DocumentsVisual Studio 2010ProjectsASP.NETuploadASP.NETuploadfile.txt This is not where the file is located. I am fairly new to .NET programming so I may have done some things incorrectly.
Here is my code:
If FileUpload1.HasFile Then
Dim fileExt As String
fileExt = System.IO.Path.GetExtension(FileUpload1.FileName)
fileExt = fileExt.ToLower
[code]....
I have successfully create a user name = 'root' and host = '127 .0.0.1 ', use the mysql command (client mode) as follow: sql = String.Format("CREATE USER '{0}'@'{1}' IDENTIFIED BY '{2}'; GRANT ALL PRIVILEGES ON *.* TO '{0}'@'{1}' IDENTIFIED BY '{2}' WITH GRANT OPTION;", userName, serverHost, userPassword) When the script above I change it to store procedure (server mode) as below, I found the error as follows: (Error 1064 - You have an error in your SQL syntax; check the manual That corresponds to Yout MySQL server version for the right syntax to use near 'pass' at line 1)
[Code]....
I'm bulding a program that willl work with a database the database is made with mysql.I would like to know if there is a way to install the DB automatically with the application without requiring the user to create a mysql server...the db have more than 5 million records.
View 3 RepliesIm new to .Net and I wondering if you have to re-create a table server control on every postback. I'm having a problem when a user clicks a button which adds a row to the table. It works fine up to about 50 rows being added then the page is extremely slow. [code]
View 1 RepliesI have a project that i have created in Visual Studio express and SQL server express. i want to create an install file so that i can send to others to install. Currently it is requiring the user to install SQL server Express and 3.5 .net framework.what steps can i take to stop the user having to install these 2 so that it is a simple install for them.
View 2 RepliesMulti-User Chat Program (Server & Client) with Main Server?
View 1 RepliesDim sqlConn As New SqlConnection("Server=.\SQLEXPRESS;uid=;pwd=;database=ContactManager")
sqlConn.Open()
Above is my connection string, The programs runs up until sqlConn.Open() and then i get the same error, using no UID and Pass, or using a uid and pass.
Login Failed For User ''. The user is not associated with a trusted sql server connection
I have the SQL Servers authentication se to Windows Authentication and SQL Authentication. I'm using Visual Studio 2005 and SQL Server 2005.
i am having a console application. I am trying to connect to a sql server.
my connection string: Data Source=<Some server>;Initial Catalog=<some database>;Trusted_Connection=True.
when i am executing on my local machine it runs successfully. But when i am trying to run it on a server it is giving me the following error:
Login failed for user ' '. The user is not associated with a trusted SQL Server connection.
do i have to change my connection string? if so what it should be?
In my scenario, users are able to upload zip files to a.[url]....I would love to create a "daemon" which in specified time intervals will move-transfer any zip files uploaded by the users from a[url].....From the info i gathered so far,
The daemon will be an .ashx generic handler.
The daemon will be triggered at the specified time intervals via a plesk cron job
The daemon (thanks to SLaks) will consist of two FtpWebRequest's (One for reading and one for writing).
how could i implement step 3?
Do i have to read into to a memory() array the whole file and try to write that in b.example.com ?
How could i write the info i read to b[url].....?
Could i perform reading and writing of the file at the same time? No i am not asking for the full code, i just can figure out, how could i perform reading and writing on the fly, without user interaction.I mean i could download the file locally from a.example.com and upload it at b.example.com but that is not the point.
I am trying to create a simple chat server over vb that can relay messages back and forth using an echo server. Could someone point me in the correct direction to begin?
View 3 RepliesI need to define some roles in my program with defined permissions. Let's say the administrator can have access only to certain features. The officer in charge to certain features and the user as well. for example, I have several group boxes and the user can access one of it only. So how i do manage these permissions? What I want do is have the roles already with the defined permissions. When I create the user and assign the role, the user should get the permission automatically.
View 6 RepliesI thought I postet this yesterday but I can't find my thread so if this is a duplicate please point me at the original one. Background: I need to create a user account and Modify it's registry before the user logs on the first time. Creating the account is done by using the Winnt provider (works great). To create the profile I'm trying to use Process.start to launch a process as the newly created user. With the use of loaduserprofile property the users profile gets created and i can do my regwrites without problem.
[Code]...
how to create a client/server... But I couldn't... I don't want anything fancy. Just want the client to send the server 4 numbers, depending on the user's choice; after that, the server would turn off the pc, restart it, etc. It all depends on the number received. Is there a rather "simple" way to do it? If it's not to much trouble you could use Atheist's example. (Btw I don't understand the code and, yes, I've checked on [URL])
View 9 Repliesbasically i just want client to say "C: emp" ENTER
then, server must reply with all its files in c: emp
I want to make a feature in it that bring all user emails from the server that added to his messenger to be added to the app in order to uses them in sending messages after that
View 13 RepliesIn my vb.net windows app, which runs on windows server 2003, i will like to return all the users who are logged into the server. How to do that?
View 3 RepliesI create an xml file from a csv file that a user uploads. What I want to do is display a link that says click here to download and have it pop up a box where they can save the specific file I just created. I can't seem to find any examples on this.
View 2 RepliesI would like to use only one user name and password to access two server. My sample codes as follow. re correct the codes
codes:
Imports System.Data
Public Class AlertControl
Public Shared Function LoginToAlert(ByVal alertUsername As String, ByVal alertPassword As String, ByVal testNumber As String) As String
[Code].....
My application needs to be able to be pointed at different SQL Servers and different databases and I would like to provide the end user with a nice method of selecting both the server and database (the app is for use by other IT staff).Ideally, I was thinking of allowing them to browse to the server (with possibly entering credentials or even better, using their Windows credentials as the databases in question should be accessible to the relevant people via their AD account), and then listing the databases on that server allowing them to select one to use.
I would like them to then be able to easily change the server and database whenever necessary.I imagine I would then need to build the connection strings based on what they select but at the moment I have got rather stuck in just trying to create a form with some kind of Server Browser (I've not got as far as a database browser!).Failing some kind of server/database browser options, I would change to some simple text boxes where the user can enter the name of the server and database directly with some kind of connection verification button.
Finally, is it easy to connect to multiple databases on the same SQL Server at the same time? Is it just a case of creating and referencing multiple connection strings?I am using VB 2008 Professional and SQL Server 2005 Standard.
I have a host page with multiple user controls in it. Some of these controls have a user created property named Enabled, and is boolean.In some controls the default value for Enabled is set to False. In the host page, I am able to access the property and set it to True. The control does what it is supposed to.On this host page there is a "Run Report" button which executes a Server.Transfer to a "Results" page.In the codebehind of the results page, control values from the PreviousPage are checked via other user created Properties for the controls and added to a ParamterList.
I am attempting to check the Enabled property of the controls on the PreviousPage, however when this is done, it appears that the Enabled property is set to that of the default (in this case False), and not what I had set it to on the page when it loaded.Does the value of this property need to be put into a hidden text box or something so its value is available after the ServerTransfer? It seems like any control which contains a value is retrievable via the PreviousPage and its user created property, but any variable set inside of the control is reset back to its default value.
At work we use External USB Modem for the users that are reporting on site, as there is non working on a chat program to link all users together, both the Server and Client are working fine over the internet, but Ive hit a snag andnot to sure how to go about fixing it.If a user closes the program data arrives to the server which is Zero in length this signifies to the server that the user has disconnected and all other users that are connected are informed of this.
View 3 RepliesI have been asked to fix a Community Server forum where thousands of users were created via a script. All of their profile pages are SEOspam for prescription drugs, etc. The forum was not using email verification or admin approval for newly registered users. I turned on the latter for now, but captcha would be nice.
My problem is that it is very cumbersome to mass delete these accounts. I set up a .net grid (Telerik Radgrid actually) so that I could mass select users and click delete. However the following code does not seem to be working (mind the VB nubbery):
Protected Sub rgUsers_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgUsers.NeedDataSource
rgUsers.DataSource = Users.GetUsers().Users()
End Sub
[code]....
The UserDeleteStatus result returns 'Success', however the user is not actually deleted. Am i using the correct delete function?
How to get the path of user shareable drive in server which can be shared by users ?
View 4 RepliesI want to make a button like this:The first image is a normal button, but the second is a button with mouseEnter event fired. The bottom part of the button in the second image is not clickable and it acts like a tool tip. How can I make this kind of a button? Do I need to use a tool tip? Please give me some code examples.
EDIT:Here's F Ruffel's code which I modified:
[code]...
Now the last problem is: the expanded part pushes all controls down, and that's what I don't want. Please modify this code to make the extended part overlay controls that are below it, just like in the image.
My project uses .NET remoting. The client connects to the server hosted in IIS to do database operations.
We have a class library that is referenced both by the client and the server. This contains basic static (shared) functions used throughout the project. An example would be a function that takes a customer/invoice number and pads it with zeros/spaces to our desired format. This works fine. There is a copy of the dll with the client and on the server in the IIS virtual directory. Both the server and the client can call these functions and they work correctly.
Now, in that same class library, I've defined two things: an enumeration (enum) and a serializable class. If I try to call a function on the server from the client that passes/returns an instance of either the enumeration or the class, I get the following
[Code]...
I have a process that sets the Terminal Server properties on AD users. It has been working fine against Windows 2003, but since trying to run it against Windows 2008, it is failing with "Access Denied" errors. I am using...
View 6 RepliesI am using help of SqlServer.Management.Smo to rename an attached MS-SQL database.
Dim db As New Database = ActiveSQLServer.Databases(OLD_NAME)
db.ExecuteNonQuery("ALTER DATABASE " & OLD_NAME & " SET SINGLE_USER WITH ROLLBACK IMMEDIATE")
db.ExecuteNonQuery("ALTER DATABASE " & OLD_NAME & " MODIFY NAME = " & NEW_NAME)
The problem is that after renaming the database is set as a Single User.So what am i doing wrong?