Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Friday, March 30, 2012

How to control MS SQL Server DataBases permissions through visual basic program

Hello,

Could someone help me to view, add, delete, and modify users of SQL Server DataBase and permissions of them on this database through Visual Basic Programming

Because I want to do VB application through which I will view, add,delete, and modify users of SQL Server DataBase and their permissions on this database.

Thank you very very muchYou can use the system stored procedures.|||Originally posted by rnealejr
You can use the system stored procedures.

Thank you very much Mr. rnealejr for your reply.

Would you like to send me a sample code in visual basic to view ,for example, users of SQL Server DataBase and their permissions??

I will be thankful|||Which version of sql server are you using 7 or 2000 ?|||Originally posted by rnealejr
Which version of sql server are you using 7 or 2000 ?
Hello, Mr. rnealejr
I use MS SQL Server 2000.
Also, I have a problem with SQL Server.
I have about 50 tables and views in an Oracle DataBase and I have tried to translate them to SQL Server DataBases.
They were translated succefully but there was two problems :
1- Key constraints were not translated? (i.e. the destination SQL Server database became without primary key and foreign key constraints and aother constraints)
2- Also, views are translated into tables not into view ??

Could you slove these problems?

After I get more information I will be able to serve your good forum with good posts becuase until now I am student

Thank you very much|||How did you translate from oracle to sql server ?|||You can use sp_helpuser, sp_helplogins - use the ado command object.|||Originally posted by rnealejr
How did you translate from oracle to sql server ?

Yes
I have used DTS Wizard to do this translation but tables were translated without constraints and also views were translated into tables instead of corresponding views although all tables, from whcih views get data, are available in the translated database.

Thank you very much Mr.

Wednesday, March 28, 2012

How to Connect VB and Visual Foxpro

I have some tables in .dbf format, I want to connect VB
and Visual Foxpro 6.0. How to connect VB with .dbf in
Visual Foxpro.Via ADO using the FoxPro ODBC or OLEDB driver.
If you need more help, post to one of the Fox groups such as
microsoft.public.fox.programmer.exchange.
--
David Portas
--
Please reply only to the newsgroup
--
"K.G.Palanisamy" <sendprasath@.yahoo.com> wrote in message
news:04cf01c3460d$605c3280$a001280a@.phx.gbl...
> I have some tables in .dbf format, I want to connect VB
> and Visual Foxpro 6.0. How to connect VB with .dbf in
> Visual Foxpro.

How to connect to SQL Server with ASP.NET

Hi
I need help to connect to SQL server, i got Microsoft Visual Web Developer 2005 Express and SQL Server Management Studio Express
With SQL Server Management Studio Express i can make databases and create tables but i dunno how to connect via asp.net
Anyone could give me a helping hand?
Thanks for the help
- Gucchi

Hi
Following is the sample create_connection method that works for me.Hope this helps you.
ALL THE BEST
Chickoo
Sub create_Conn()

Dim oConnectionAs SqlConnection

Dim DAAs SqlDataAdapter

Dim DSAsNew DataSet

Dim sSQLAsString

Dim sConnAs SqlConnection =New SqlConnection("workstation id=<xxx>;packet size=4096;integrated security=SSPI;data source=<xxx >;persist security info=False;initial catalog=<Database Name>;Trusted_Connection=Yes")

sSQL = " SELECT * FROM MyDatabase"

DA =New SqlDataAdapter(sqlstr, sConn)

DA.Fill(DS, "MyTable")

MyGrid.DataSource = DS

MyGrid.DataBind()

sConn.Close()

EndSub

sql

how to connect to SQL server express 2005 database at the same time from both SSMSE and VB2005 a

Here is the situation:

I have SQL server express 2005 installed on my pc as instance SQLEXPRESS.

I have created a Visual Basic applicaion with the following as connection to the SQL server express 2005 running on the same PC:
****************************************************************************************************
Dim lconnectionString As String
Dim builder As New SqlConnectionStringBuilder
Dim cmd As New SqlCommand
Dim reader As SqlDataReader
Dim parameter As SqlParameter


builder("Data Source") = ".\SQLEXPRESS"
builder("Initial Catalog") = ""
builder("AttachDbFilename") = "C:\My Documents\Visual Studio 2005\Projects\abc\abc\abc.mdf"
builder("Integrated Security") = True
builder("User Instance") = True
lconnectionString = builder.ConnectionString

Dim sqlConnection1 As New SqlConnection(lconnectionString)

cmd.CommandText = "SP_add_collection"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = sqlConnection1

sqlConnection1.Open()
*******************************************************************************************************************

It seems that i can not connect to the abc.mdf in SSMSE while the VB program is running. (ERROR:
Database 'C:\My Documents\Visual Studio 2005\Projects\abc\abc\abc.mdf' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details. (.Net SqlClient Data Provider) )

If i connect to the abc.mdf first in SSMSE, then run the VB program afterwards, it gives me the error on this line -- sqlConnection1.Open()

I want to be able to access the abc.mdf database with both SSMSE and VB at the same time. Could anyone help me on this ?

Thanks very much !

apple

I'll go out on a limb here and assume that you've attached the .mdf to SSMSE which is essentially just a pointer to the db. It is not technically a SQL database.

When you're connecting the .mdf through code, use the same connection as if you were connecting to MS Access.

If you have a stored procedure that uses the .mdf, use a sql connection.

Good luck,

Adamus

|||yes, i attached the .mdf file to the SSMSE. and i call the stored procedures in the VB application.

I want to see the result of data change of the VB application in the SSMSE right away, while the application updates the date in the table. is it possible ?|||

Yes it's possible but you have to connect directly to the .mdf not SSMS.

Adamus

sql

how to connect to SQL server express 2005 database at the same time from both SSMSE and VB20

Here is the situation:

I have SQL server express 2005 installed on my pc as instance SQLEXPRESS.

I have created a Visual Basic applicaion with the following as connection to the SQL server express 2005 running on the same PC:
****************************************************************************************************
Dim lconnectionString As String
Dim builder As New SqlConnectionStringBuilder
Dim cmd As New SqlCommand
Dim reader As SqlDataReader
Dim parameter As SqlParameter


builder("Data Source") = ".\SQLEXPRESS"
builder("Initial Catalog") = ""
builder("AttachDbFilename") = "C:\My Documents\Visual Studio 2005\Projects\abc\abc\abc.mdf"
builder("Integrated Security") = True
builder("User Instance") = True
lconnectionString = builder.ConnectionString

Dim sqlConnection1 As New SqlConnection(lconnectionString)

cmd.CommandText = "SP_add_collection"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = sqlConnection1

sqlConnection1.Open()
*******************************************************************************************************************

It seems that i can not connect to the abc.mdf in SSMSE while the VB program is running. (ERROR:
Database 'C:\My Documents\Visual Studio 2005\Projects\abc\abc\abc.mdf' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details. (.Net SqlClient Data Provider) )

If i connect to the abc.mdf first in SSMSE, then run the VB program afterwards, it gives me the error on this line -- sqlConnection1.Open()

I want to be able to access the abc.mdf database with both SSMSE and VB at the same time. Could anyone help me on this ?

Thanks very much !

apple

I'll go out on a limb here and assume that you've attached the .mdf to SSMSE which is essentially just a pointer to the db. It is not technically a SQL database.

When you're connecting the .mdf through code, use the same connection as if you were connecting to MS Access.

If you have a stored procedure that uses the .mdf, use a sql connection.

Good luck,

Adamus

|||yes, i attached the .mdf file to the SSMSE. and i call the stored procedures in the VB application.

I want to see the result of data change of the VB application in the SSMSE right away, while the application updates the date in the table. is it possible ?|||

Yes it's possible but you have to connect directly to the .mdf not SSMS.

Adamus

How to connect to SQL server 2005 from C# after default installation?

Hi everyone,

I just installed Visual Studio 2005 and SQL Server 2005. However, I`m not able to connect to the database.

When running this C# code, I get a SqlException.

using System; using System.Data; using System.Data.SqlClient; class Program {
static void Main(string[] args) {
SqlConnection connection = new SqlConnection(); connection.ConnectionString = "Data Source=(local)\\sqlexpress;Initial Catalog=X;Integrated Security=True;"; connection.Open(); connection.Close();
}
}

I get the following error message:

Cannot open database X requested by the login. The login failed.
Login failed for user Y.

Can anyone tell me how to connect to sql server 2005 after default installation? Any help would be appreciated! :-)

Jan

Most likely your user ID does not exist in a list of the logins for the database. You need to grant an access for your Windows account to the database. Check next links with some info

http://support.microsoft.com/kb/325003/en-us#XSLTH4213121122120121120120

http://support.microsoft.com/kb/240872/en-us

|||Thx, my program runs!

I executed the following command (in VS Command Prompt) to add my windows account to the list of database accounts.

C:\>osql -E -S (local)\sqlexpress
1> EXEC sp_grantlogin 'machine_name\user_name'
2> go
1> exit

Monday, March 26, 2012

How to connect to Sql Server

Dear Sir and Madam:
I am now using Visual Foxpro 8 connect to MS Sql server 2000 (Personal Edition).
Now, I have a serious problem that I can not connect SQL Server from client machine and it raises the following message :
SQL Server does not exist or access denied

But it worked when I connect at Server. I don't know the reason why

Here is My Server Configuation
Computer Firewall is OFF
Authentication : SQL Server and Windows
Connectstring="DRIVER=SQL Server;SERVER=HUNG1975;DATABASE=sales;UID=sa;PWD=sa;Trusted_Connection=False;DispLogin=3;ConnectTimeout=3"

Please help me
Thank you very very much.

Hi,

make sure that you are using the right port and that the user and the password is valid can access the database.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

how to connect to database in SQL Sever Managment Studio

hi

i have created a .aspx page and a sql database in visual studio ,, my question is how can i connect that database in SQL Server Managment Studio?

Just use SqlConnection to refer to any database on SQL Server as you likeSmileYou can start from here:

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(d=ide).aspx

|||

thanks for the answer ,, but i still need some help.. I i have never used the sql managment studio before...the sql database iam trying to connect to is on my harddrive in the App_data folder in my asp project ,,,, when i start SQL Managamenet studio it wants me to enter the

Server Name:

Server Type:

Authentication

so i typ in

Server Type: Database Engien

Authentication: Windows Authenication

Server Name: mycomputer\SQLEXPRESS this is set by defult

so when i click on connect , it connects to the mycomputer\SQLEXPRESS. am i suppose to find my database among the databases that is in the Object Explorer?

this is my connection string that i found in the web.config file

connectionString

="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient"/>

thank you for your help

by the way ,, the reason why i want to connect my to my database in sql management studio is that i want to enable full text search and indexing

|||

To manage database file in Management Studio, you have to 'register' the database file under the App_Data to the SQL instance. We can use detaching/attaching to do this: firstly in VS2005 right click the database file ->choose Detach; then in Management Studio right click Databases-> choose Attach. There are a lot of materials in SQL2005 Books Online, here is a start link:

http://msdn2.microsoft.com/en-us/library/ms190794.aspx

How to connect to AS 2000

Hi all,

Currently I am working on the Window 2003 Enterprise 64-bit with SQL 2005 Enterprise and Visual Studio Professional install. I try to write a console application using Visual Studio to connect to the Analysis Server 2000, but I get the follow error message:

ErrorTongue Tiedystem.Runtime.InteropServices.COMException (0x800A0E7A): Provider cannot be found. It may not be properly installed.
at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options)
at ExceptionCheck.Module1.Hodb03_ItemSales() in Z:\Visual Studio\Console\ExceptionCheck\ExceptionCheck\Module1.vb:line 16"

I know if I want to connect to the Analysis Service 2000, I need to install the Microsoft SQL Server 2000 PivotTable Services. After I install the services, I still get the error message.

Thanks,

Tomas

Hi,

Try to re-register msolap (regsvr32 msolap80.dll from "%ProgramFiles%\Common Files\System\Ole DB"). If you get the same error, let's check with the MDX Sample application (ships with AS2000, you can copy it from another machine). If you get the same error, then you probably have corrupted installation of the Pivot Table Service.

|||

Hi,

I tried to re-register msolap, but it didn't help.

|||The MDX Sample application failed with the same error ? Beside re-installing PTS, can't think of something else.

Friday, March 23, 2012

how to connect sql server 2005 cube using visual studio 2005

May i know how to connect sql server 2005 cube using visual studio 2005 ?
May i have some examples and source code to solve this problem ?

Thanks a lot.Please direct these types of questions to the SQL Server Analysis Server forum: http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=83

how to connect from visual studio to a ms sql 2005 database on a server

Hello,

I have visual studio 2005 installed on my PC. I want to create a new website and I want the site to be connected to a MS SQL 2005 database that resides on my hosting account. I am thinking this can be done but I have watched videos, spent time looking for a site to help and I have hit a brick wall.

I have no idea how to do this.

Can anyone please help me with some instructions or a webpage that shows you how to do this.

Thank You

Joe

Hello,

I have found the solution and would like to share it with anyone that needs this info.

I have found you can connect to a ms sql 2005 database that resides on your hosting account either by
using the Visual Web Developer Express Edition which is free or Microsoft Visual Studio.

The first thing you need is asp 2.0 hosting account and a ms sql 2005 database activated on your hosting account.

The below will work for both versions of software mentioned above.

1. OPen your desired software program and Create a New Website

2. In the database explorer right mouse click on Data Connections and add a new connection.

Datasource = Microsoft SQL Server (SQL Client)

Server Name = This should of been supplied by your hosting provider eg sql26565.aspprovider.net

Select - Use SQL Authorisation

User Name = your username for your database (this should be provider by your provider)

Password = your password for the database (this should be provider by your provider)

Select the database from within the connect to database tab

Click ok and the database should be connected and appears under the Data Connections Folder.

If you need to know how to add grids etc there are lots of very handy videos which with what you learn will work on both versions of teh software programs mentioned here.

I Hope this helps anyone that had faced the same issue that I have. So many learning videos out there but an important step that has been missed due to the focus on the express editions.

Thanks

Joe

|||If you need to know how to add grids etc pls visit which applies to both versions of the
software mentioned. --> http://msdn.microsoft.com/vstudio/express/vwd/learning/default.aspx

Monday, March 19, 2012

How to Configure SQLServer with VSS6.0

I would like to configure Sql Server 2000 with Visual Source Safe 6.0
can any one guide me how to go about ...
atleast URLs that discuss on this work
thanks
SatishHi Satish,
Dint get ur Query Exactly. Looking for something Like this?
http://www.mssqlsourcesafe.com/mssqlXpress_Download.shtm
Best Regards
Thirumal
>--Original Message--
>I would like to configure Sql Server 2000 with Visual
Source Safe 6.0
>can any one guide me how to go about ...
>atleast URLs that discuss on this work
>thanks
>Satish
>
>.
>|||Satish,
There is no direct integration that I know of.
Save database objects such as stored procedures and triggers from Query Analyser or Enterprise Manager or a
Database project to file
Check them in and out from sourcesafe as files.
There have been a few discussions. You might try reading the archives:
http://www.google.com/advanced_group_search?hl=en
with sourcesafe as the subject, searching in microsoft.public.sqlserver.server
Regards
AJ
p.s. You can do mean/clever things like loading / overwriting SQL objects from sourcesafe using .bat files as
a means of enforcing that
developers use sourcesafe - as unlike a filesystem based project, the "sourcecode" is in the database and is
readwrite beyond sourcesafe's control, so it takes a certain discipline to always check the file out before
you modify the object in SQL.
"Satish" <kvensatish@.hotmail.com> wrote in message news:eguWRNrQDHA.2636@.TK2MSFTNGP10.phx.gbl...
> I would like to configure Sql Server 2000 with Visual Source Safe 6.0
> can any one guide me how to go about ...
> atleast URLs that discuss on this work
> thanks
> Satish
>