Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





T-SQL And Visual Basic 2005 Codes That Execute A User-Defined Stored Procedure In Management Studio Express (Part 2)


Hi Jonathan Kehayias,  Thanks for your valuable response. 
 
I had a hard time to sumbit my reply in that original thread yesterday.  So I created this new thread.
 
Here is my response to the last code/instruction you gave me:

I corrected a small mistake (on Integrated Security-SSPI and  executed the last code you gave me. 

I got the following debug error message:

1) A Box appeared and said:   String or binary data would be truncated.

                                             The statement has been terminated.

                                                            |OK|

2) After I clicked on the |OK| button, the following message appeared:

                                   This  "SqlException was unhandled

                                             String or binary data would be truncated.

                                             The statement has been terminated."

                                    is pointing to the "Throw" code statement in the middle of

                                                                                 .......................................

                                                                                 Catch ex As Exception

                                                                                       MessageBox.Show(ex.Message)

                                                                                       Throw

                                                                                  Finally

                                                                                  ..........

Please help and advise how to correct this problem in my project that is executed in my VB 2005 Express-SQL Server Management Studio Express PC.

 

Thanks,
Scott Chang 
 
The code of my Form1.vb is listed below:

Imports System.Data

Imports System.Data.SqlClient

Imports System.Data.SqlTypes

Public Class Form1

Public Sub InsertNewFriend()

Dim connectionString As String = "Data Source=.SQLEXPRESS;Initial Catalog=shcDB;Integrated Security=SSPI;"

Dim connection As SqlConnection = New SqlConnection(connectionString)

Try

connection.Open()

Dim command As SqlCommand = New SqlCommand("sp_insertNewRecord", connection)

command.CommandType = CommandType.StoredProcedure

command.Parameters.Add("@procPersonID", SqlDbType.Int).Value = 7

command.Parameters.Add("@procFirstName", SqlDbType.NVarChar).Value = "Craig"

command.Parameters.Add("@procLastName", SqlDbType.NVarChar).Value = "Utley"

command.Parameters.Add("@procAddress", SqlDbType.NVarChar).Value = "5577 Baltimore Ave"

command.Parameters.Add("@procCity", SqlDbType.NVarChar).Value = "Ellicott City"

command.Parameters.Add("@procState", SqlDbType.NVarChar).Value = "MD"

command.Parameters.Add("@procZipCode", SqlDbType.NVarChar).Value = "21045"

command.Parameters.Add("@procEmail", SqlDbType.NVarChar).Value = "CraigUtley@yahoo.com"

Dim resulting As String = command.ExecuteNonQuery

MessageBox.Show("Row inserted: " + resulting)

Catch ex As Exception

MessageBox.Show(ex.Message)

Throw

Finally

connection.Close()

End Try

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

InsertNewFriend()

End Sub

End Class
 




View Complete Forum Thread with Replies

Related Forum Messages:
T-SQL And Visual Basic 2005 Codes That Execute A User-Defined Stored Procedure In Management Studio:How To Declare EXEC && Sp?
Hi all,
 
In my SQL Server Management Studio Express (SSMSE), I executed the following sql code suuccessfully:
--insertNewRocord.sql--

USE shcDB

GO

CREATE PROC sp_insertNewRecord @procPersonID int,

                                                       @procFirstName nvarchar(20),

                                                       @procLastName nvarchar(20),

                                                       @procAddress nvarchar(50),

                                                       @procCity nvarchar(20),

                                                       @procState nvarchar(20),

                                                       @procZipCode nvarchar(20),

                                                       @procEmail nvarchar(50)

AS INSERT INTO MyFriends

VALUES (@procPersonID, @procFirstName, @procLastName, @procAddress,

@procCity, @procState, @procZipCode, @procEmail)

GO

EXEC sp_insertNewRecord 7, 'Peter', 'Wang', '678 Old St', 'Detroit',

'Michigon', '67899', 'PeterWang@yahoo.com'

GO

=======================================================================
Now, I want to insert a new record into the dbo.Friends table of my shcDB by executing the following T-SQL and Visual Basic 2005 codes that are programmed in a VB2005 Express project "CallshcDBspWithAdoNet":
--Form1.vb--

Imports System.Data

Imports System.Data.SqlClient

Imports System.Data.SqlTypes

Public Class Form1

Public Sub InsertNewFriend()

Dim connectionString As String = "Integrated Security-SSPI;Persist Security Info=False;" + _

"Initial Catalog=shcDB;Data Source=.SQLEXPRESS"

Dim connection As SqlConnection = New SqlConnection(connectionString)

connection.Open()

Try

Dim command As SqlCommand = New SqlCommand("sp_InsertNewRecord", connection)

command.CommandType = CommandType.StoredProcedure
 

EXEC sp_insertNewRecord 6, 'Craig', 'Utley', '5577 Baltimore Ave',

'Ellicott City', 'MD', '21045', 'CraigUtley@yahoo.com'

 
Console.WriteLine("Row inserted: " + _

command.ExecuteNonQuery().ToString)

Catch ex As Exception

Console.WriteLine(ex.Message)

Throw

Finally

connection.Close()

End Try

End Sub

End Class

===========================================================
I ran the above project in VB 2005 Express and I got the following 5 errors:
1. Name 'EXEC' is not declared  (in Line 16 of Form1.vb)
2. Method arguments must be enclosed in parentheses (in Line 16 of Form1.vb)
3. Name 'sd-insertNewRecord' is not declared. (in Line 16 of Form1.vb)
4.Comma, ')', or a valid expression continuation expected (in Line 16 of Form1.vb)
5. Expression expected (in Line 16 of Form1.vb)
============================================================
I know that "EXEC sp_insertNewRecord 6, 'Craig', 'Utley', '5577 Baltimore Ave',

'Ellicott City', 'MD', '21045', 'CraigUtley@yahoo.com'  "in Line 16 of Form1.vb is grossly in error.
But I am new in doing the programming of T-SQL in VB 2005 Express and I am not able to change it.

Please help and advise me how to correct these problems.
 
Thanks in advance,
Scott Chang

View Replies !
User 'Unknown User' Could Not Execute Stored Procedure - Debugging Stored Procedure Using Visual Studio .net
Hi all,

 

I am trying to debug stored procedure using visual studio. I right click on connection and checked 'Allow SQL/CLR debugging' .. the store procedure is not local and is on sql server.

 

Whenever I tried to right click stored procedure and select step into store procedure> i get following error

 

"User 'Unknown user' could not execute stored procedure 'master.dbo.sp_enable_sql_debug' on SQL server XXXXX. Click Help for more information"

 

I am not sure what needs to be done on sql server side

 

We tried to search for sp_enable_sql_debug but I could not find this stored procedure under master.

Some web page I came accross says that "I must have an administratorial rights to debug" but I am not sure what does that mean?

 

Please advise..

Thank You

View Replies !
SQL Server Management Studio Express: Object Explorer - How To Re-attach The Content Of User-defined Database
Hi all,

 

I just found that the content of my Database "ssmsExpressDB" is gone, but the name "ssmsExpressDB" remains in the Object Explorer of SQL Server Management Studio Express.  If I delected the name "ssmsExpressDB" and executed the following .sql:

         

                exec sp_attach_db @dbname = N'ssmsExpressDB',

                @filename1 = N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB.mdf',

                @filename2 = N'C:Program filesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB_log.LDF'

                GO

 

I got the following error message:

               

Msg 5120, Level 16, State 101, Line 1

Unable to open the physical file "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".

 

 

And I have closed all my projects and I do not know what " The process cannot access the file because it is being used by another process" is all about!?   Please help and tell me how I can re-attach the content of my "ssmsExpressDB" in the Object Explorer of SQL Server Management Studio Express.

 

Thanks in advance,

Scott Chang

====================================================================================

I found the "ssmsExpressDB" is being used by my VB 2005 Express project "Hello-SQLCLR-1":  in the Database Explorer, Data Connections place.  How can I put it back to the Object Explorer of SQL Server Management Studio Express?  Please help and advise.

=======================================================
 
 

View Replies !
SQL Server Management Studio Express: Object Explorer - How To Re-attach The Content Of User-defined Database
Hi all,
 
I just found that the content of my Database "ssmsExpressDB" is gone, but the name "ssmsExpressDB" remains in the Object Explorer of SQL Server Management Studio Express.  If I delected the name "ssmsExpressDB" and executed the following .sql:
         

                exec sp_attach_db @dbname = N'ssmsExpressDB',

                @filename1 = N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB.mdf',

                @filename2 = N'C:Program filesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB_log.LDF'

                GO
 
I got the following error message:
               

Msg 5120, Level 16, State 101, Line 1

Unable to open the physical file "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
 
 
And I have closed all my projects and I do not know what " The process cannot access the file because it is being used by another process" is all about!?   Please help and tell me how I can re-attach the content of my "ssmsExpressDB" in the Object Explorer of SQL Server Management Studio Express.
 
Thanks in advance,
Scott Chang
====================================================================================
I found the "ssmsExpressDB" is being used by my VB 2005 Express project "Hello-SQLCLR-1":  in the Database Explorer, Data Connections place.  How can I put it back to the Object Explorer of SQL Server Management Studio Express?  Please help and advise.
=====================================================================================
 

View Replies !
How To Configure SQL Server Management Studio Express To Allow Doing Non-User-Instance/ADO.NET 2.0 From VB 2005 Express?
Hi all,
 
For the first time, I want to set up the configuration of my SQL Server Management Studio Express (SSMSE) to allow me in doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express. The SSMSE and VB 2005 Express are in my Windows XP Pro PC that is part of our NT 4 LAN System in our office.  I read the article "How to configure SQL Server 2005 to allow remotre connections" in http://support.microsoft.com/kb/914277/  about (i) "Enable remote connections for SQL Server 2005 Express", (ii) Enable the SQL Server Browser service", (iii) Create exception in Windows Firewall, and (iv) Create an exception for the SQL Server Browser service in Windows Firewall. I entered the SQL Server Surface Area Configuration and I could not decide what options I should take for doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express.  I have the following questions on the page of "Minimize SQL Server 2005 Surface Area":
(1)  I saw "Configure Surface Area for localhost [change computer]".   I clicked on  [change computer] and I saw the
      following:   Select Computer
                      The Surface Area Configuration of this surface area of this computer or a remote computer.
                      Specify a computer to configure:  O Local computer
                                                                       O Remote computer
                       Should I choose the "Local computer" or the "Remote computer" option?
(2) Below the "Configure Surface Area for localhost [change computer]", 
    I clicked on "Surface Area Configuration for Service and Connections",  Select a component and then configure its services and connections:  |-|  SQLEXPRESS
                                          |-| Database Engine
                                                    Service
                                I picked =>   Remote Connection
       On the right-hand side, there are:     O Local connections only
                                                            O Local and remorte connections
                                                                   O Using TCP/IP
                                                                   O Using named pipes only
                                                                   O Using both TCP/IP and named pipes
                        Should I choose   O Local and remorte connections and O Using named pipes only?
 
Please help and tell me what options I should choose in (1) and (2).
 
Thanks in advance,
Scott Chang                                          

View Replies !
Simple Examples Of SQLCLR By Connecting To SQL Express User Instances In Management Studio Via VB 2005 Express
Hi all,
I want to do SQLCLR by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express and I have read the following articles and books:
(i) Connecting to SQL Express User Instances in Management Studio in http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-insta...
(ii) Managing SQL Server Express with SQL Server 2005 Management Studio Express Edition in http://www.microsoft.com/technet/sql/2005/mgsqlexpwssmse.mspx
(iii) Chapter 16 - Going Beyand Transact-SQL: Using the SQL Common Language Rutime (SQLCLR) in Microsoft SQL Server 2005 Express Edition for Dummies
(iv) Chapter 21 - Working with the Common Language Runtime in Microsft SQL Server 2005 Programming for Dummies
(v) Chapter 4 - Introduction to Common Language Runtime (CLR) Integration in Programming SQL Server 2005 by Bill Hamilton.
I want to create an SQLCLR project "HelloWorld" by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express. But I am still not sure how to get it started, because I do not understand the following things:
(1) Pipe Name for a User Instance, (2) Enabling (or Disabling) the CLR by using Transact-SQL, (3)  Creating a Transact-SQL script, (4) Creating an Assembly, (5) Creating a backup device, etc. I need to see some simple examples of SQLCLR by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express.  Please help and tell me where in the websites I can find them.
 
Thanks in advance,
Scott Chang 

View Replies !
Server Express, Management Studio Express, Visual Studio Standard, And An ASP.NET Page....
I believe I'm missing something as far as my configuration goes...I'm new to working with SQL server and the databinding I'm trying to do.

I have an ASP.NET page that has a radio button list box which I have databound to a database served up by SQL Express

I'm having a lot of problems with connections...

I was going to enumerate the behavior under each configuration (local only, remote tcp/ip only, remote pipes only, remote both), but I've realized that it is just flaky.  Sometimes I can connect to the db with SQL Studio express, sometimes not.  Sometimes I can add new tables and edit tables, sometimes not.  Sometimes I can create a new connection when trying to databind from within Visual Studio, and sometimes not (sometimes I can't even connect, other times, I can connect initially but when I build a query through the designer it then has problems).  Lastly, sometimes the ASP.NET page works correctly and sometimes not.

This all seems to be mostly independent of how I configure SQL Server as far as what kinds of connections are allowed.  I thought there was a pattern, but as I tested it more rigorously I found there wasn't.

What I would like to do is be connected to the same DB with Visual Studio and SQL Studio, edit the DB as I wish, databind to it, and test my ASP.NET page, all without needing to jump through a bunch of hoops (although right now I wouldn't even know what those hoops are...it's just a shot in the dark as to what will work).

It's all quite maddening and any help would be appreciated. 

View Replies !
I Need To Add A Row To A SQL CE Database If It Does Not Exists.I Am In Visual Studio 2005 Using Visual Basic 2005.
I need to add a row to a SQL CE database if it does not exists using Visual Basic 2005 in Visual Studio 2005.  I can't seem to find the duplicate record using a tableadapter query.  It adds the same record again.  I am trying to use tableadapters, but do not have to. Any suggestions?
 

 
Here is the add row code I am using...
 

checkCustRow = PcDatabase1.MainToolData.NewMainToolDataRow()

checkCustRow("Name") = ""

checkCustRow("Size1") = cmbSize1

checkCustRow("Size2") = ""

checkCustRow("Size3") = ""

checkCustRow("Size4") = ""

checkCustRow("Pressure1") = cmbPressure

checkCustRow("Pressure2") = ""

checkCustRow("Pressure3") = ""

checkCustRow("Pressure4") = ""

checkCustRow("Category") = "BOPs"

checkCustRow("VSSName") = "BOPs.vss"

checkCustRow("Type") = cmbType

checkCustRow("Manufacturer") = "WFT"

checkCustRow("Height") = cmbHeight

checkCustRow("Width") = cmbWidth

checkCustRow("Weight") = cmbWeight

checkCustRow("VolumeOpen") = cmbOpen

checkCustRow("VolumeClosed") = cmbClosed

checkCustRow("EndConnection") = ""

checkCustRow("Userdefined") = "T"

PcDatabase1.Tables("MainToolData").Rows.Add(checkCustRow)

Dim ta As New PCDatabaseTableAdapters.MainToolDataTableAdapter

ta.Update(PcDatabase1.MainToolData)
 
 
Any suggestions?

 
Jeff

View Replies !
Visual Studio Database File And SQL Server Management Studio Express Question
I have a database in my "App_Data" folder of my visual studio project.  I can view it fine in Visual Studio's built-in tools for managing a database attached to a solution.  However i recently started playing around with the SQL Server Management Studio Express program.  When i attach my database to Management Studio, and try to run my program it crashes.  I think it might be a permissions error?!? When i detatch it and reattach it in visual studio it runs fine again.   Any suggestions? ThanksJason 

View Replies !
How Do I Create A Stored Procedure In SQL Server Management Studio Express?
I have wrriten many stored procedures in the past without issue, but this is my first time using SQL Server Management Studio Express.  I am having trouble creating a new stored procedure.  Here is what's happening:
I am opening my database, right clicking on "Stored Procedures" and selecting "New Stored Procedure".  A new window opens with a template for creating a stored procedure.  The window is called: "SQLEXPRESS.DBName - sqlquery1.sql".  I then type up my stored procedure without an issue.
However, when I go to save the stored procedure it wants to save it as a separate file in a projects folder.  It does not become part of the DB (as far as I can tell).
When I used to use Enterprise Manager (not an option anymore) this never happened.
I'm sure I'm doing something dumb.  Can someone enlighten me.
Thanks,Chris

View Replies !
How To Empty A Stored Procedure In Ms Sql Server Management Studio Express
hi everyone,

I have a db based on the Tracking_Schema.sql / Tracking_Logic.sql (find in &windir%/Microsoft.NET/Framework/v3.0/Windows Workflow Foundation/SQL/EN), so after executing both of them I get several stored procedures, especially dbo.GetWorkflows. And I have a solution in VS05 which when executed is filling this stored procedure with Instance-Id´s. My question is: how is the working command (like exec, truncate,..) to empty my st.procedure, not to drop/delete it?

 

Thanks in advance, best regards

bg

View Replies !
Is Management Studio Express Compatible With Visual Studio?
I have installed Visual Studio 2005 which includes SQL Server Express but not the Management Studio.

Can I install SQL Server Management Studio Express?

 

View Replies !
Debugging Stored Procedure From Visual Studio 2005
 Hi ,I am using Visual studio 2005 with sql server 2005. I want to debug my stored procedure, which is situated on the server on the network(accessible through network share). I followed the following URL: http://aspnet.4guysfromrolla.com/articles/051607-1.aspxI have used Direct database debugging : When I right click my stored procedure and click 'step into stored procedure', I get the following error: "Unable to start T-SQL debugging. could not attach
to SQL server process on 'sql_server_name'. The remote procedure call failed and did not
execute" I am using windows authentication to  login to sql server Any help?  

View Replies !
Debugging Stored Procedure From Visual Studio 2005
Hi ,

I am using Visual studio 2005 with sql server 2005. I want to debug my stored procedure, which is situated on the server on the network(accessible through network share). I followed the following URL:


http://aspnet.4guysfromrolla.com/articles/051607-1.aspx


I have used Direct database debugging : When I right click my stored procedure and click 'step into stored procedure', I get the following error:


"Unable to start T-SQL debugging. could not attach to SQL server process on 'sql_server_name'. The remote procedure call failed and did not execute"


I am a sysadmin in SQL server. I am using windows authentication to login to sql server


Any help?

View Replies !
How To View Permissions Of User-defined Database Roles In Management Studio?
As part of our security project, I've done the following when logged in as 'sa':

Created database roles 'dbrole1' within dbAccount

Created login and user 'user1' and added user to be a member of 'dbrole1'

Granted execute permissions on sp1 and sp2 to 'dbrole1'

However, I didn't see the above permissions listed in SQL Server Management Studio - Database - Security - Roles - Database Roles - 'dbrole1' properties - securables

Any ideas?  Thanks!

View Replies !
SQL Server Management Studio Express, Database Explorer In Visual Web Developer Express...which To Use???
When I downloaded/started using Visual Web Developer I was under the impression that I needed to install SQL Server Management Studio Express in order to create/manage databases, and to provide the engine to access the data.
 Since then I have found tutorials and have successfully created/used databases solely from within Visual Web Developer. I'm assuming that Visual Web Developer includes a database engine, much like the webserver that is included. (This is an awesome thing).
 When I tried to upload my web application with database to my production server, the database would not work, it started working after I installed SQL Server Management Studio Express on the server.
 Is it my understanding that you need SQL Server Management Studio Express if you do not have Visual Web Developer Express installed in order to provide the data access engine?
Also, I am unable to "attach" my Visual Web Developer Express created database to SQL Server Management Studio Express. Are there any posts that provide more information about this topic?
 
The only reason I'm asking is that I have extra whitespace on the end of my text fields, and I thought ANSI_PADDING was turned on. I do not see the option in Visual Web Developer Express, but have found it in SQL Server Management Studio Express.

View Replies !
Visual Studio 2005 Standard And SQL Server Management Studio?
I am new to visual studio and I am still not sure of all its components and features.

I installed visual studio 2005 standard edition but cannot find SQL Server Management Studio?

I guess this must be because it is not included with Visual studio 2005 standard. Is it included with VS 2005 professional?

I want to add pictures of products to my shopping site using an SQL database and I’ve been told that SQL Server Management studio is required as it is a graphical tool.

How would I go about obtaining the SQL server management studio. There seems to be different versions of SQL server that it is confusing to know which one to purchase.

Will the SQL server 2005 version that comes with Visual studio standard be sufficient for me now right? I want to create a shopping site with hundreds, perhaps even thousands of products. I want to use an SQL server 2005 database. The database will include ‘dynamically generated’ product images if that is the correct terminology.

My goodness, it seems I still have so much to learn.

Thanks

View Replies !
How Can I Onnect Visual Basic Express 2005 To A Remote SQL Server Express 2005?
HiIm trying to connect Visual Basic Express 2005 to a remote SQL Server Express 2005. I cant find how i can do that in VB.net Express.In Web developer there are no problem to connect to a remote SQL server but i cant find it in VB.net Express. The XP with the SQL server that i want to connect to is on the local network. Greatful for help!

View Replies !
Visual Basic 2005 Express And SQL Server 2005 Express - Display Image
Hi Guys,
I created a Product database table using Visual Basic 2005 Express and SQL Server 2005 Express. I have just added a new column [Picture] to the database table, which of course, should store an image or picture of a product. I am writing to kindly ask you guys for help .


i) How do I include image files into this column [Picture]?
ii) How do I get this image to display on Visual Basic 2005 Express form, so that when a product is selected the product image is displayed accordingly?


Your help much appreciated. Thanks.
 
Paul

View Replies !
System.Data.ConstraintException Visual Basic 2005 Express / SQL 2005 Express
This problem only occurs after deployment, not when debugging.  In the table I am having a problem with I have an ID field designated as the primary key with the identity increment set to 1 and the identity seed set to 1.  There is no data in the table when deployed.  I can add records to the datagridview control but when I try updating the dataset I get this error indicating that the ID field already has a value of 1 present.  If I close the application and re-start it, the exception no longer occurrs when I update the dataset.  I am including the code to update the tables incase something is wrong there.  Any suggestions?

Private Sub UpdateMemberTable()

Me.Validate()

Me.TblMembersBindingSource.EndEdit()

Me.TblMembersTableAdapter.Update(Me.ChurchFamilyDataSet.tblMembers)

Me.TblMemberDependentsBindingSource.EndEdit()

Me.TblMemberDependentsTableAdapter.Update(Me.ChurchFamilyDataSet.tblMemberDependents)

Me.TblMemberContributionsBindingSource.EndEdit()

Me.TblMemberContributionsTableAdapter.Update(Me.ChurchFamilyDataSet.tblMemberContributions)

End Sub

View Replies !
SQL Express && Visual Basic 2005
Hello,

 

Iam new to Visual basic 2005, I have installed SQL Express and prefers to use ADODB to connect to the database.

This is the code i tried

con.Open(cstring1 = "Provider=SQLNCLI.1;" _

 & "Server=(local);" _

 & "Database=D:VS 2005 ProjectsMyDB.mdf;" _

 & "Integrated Security=SSPI;" _

 & "DataTypeCompatibility=80;" _

 & "Data Source=server1sqlexpress")

 

The error is comexception was unhandled,

SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].

 

Can anyone help me out.

I have SQLExpress installed and Visual studio 2005 installed.

Connection string for ADODB ??

 

Regards,

 

Sathyan

 

View Replies !
Visual Basic 2005 Express - SQL Problem
Hi all, I have a var called sEP which contains a number. The problem I have is calling that var during an SQL query within Visual Basic.  To test the update string I wrote the following query and simply told it to enter the text "Five Stars" on the row which contains the entry '1' in Episode Number column. It works fine. UPDATE JackBennySET Rating= 'Five Stars'
WHERE ([Episode Number]= '1') But how do I replace the '1' in the query with the var sEP (which will contain the actual number I want the query to run against)?I have tried various suggestions from sources including:UPDATE JackBenny SET Rating = 'Five Stars' WHERE [Episode Number] = '" + sEp + "'However, they all fail to update the database at all which makes me think the syntax is incorrect.Any help is very appreciated (I have been seeking help in various places for 2 days now) - I always send small paypal tips to people who help me on forums.       

View Replies !
SQL Express 2005 Replication Via Visual Basic
yiotis writes "Is there a way where you can programmatically (via visual basic) replicate two or more SQL Express databases located on multiple computers without the need of SQL Server 2005 acting as a publisher. From what i understand this is a limitation in SQL Express.

Right now i have SQL Express installed on 2 machines. I am able via vb to communicate with each database, read and write data between databases but cannot seem to figure out how to perform a simple replication.

Bottom line is, i need to be able to replicate via vb code 2 sql express databases with each other.

Thanks"

View Replies !
Stored Procedure Error When Run From Visual Basic In Access
I am working in an access data project. I have a stored procedure that runs fine when I open and run it directly in sql. When I use the DoCmd.OpenStoredProcedure method in VB code, the stored procedure also runs fine (and successfully adds records as it should) but then I
get an error: #7874 "...can't find the
object...'[Name of sp'". This halts the vb code and is a
problem. Here's example code from a sp that causes
this problem:

Insert into Table (Field1, Field2, Field3, Field4)
Select Field1, 'Test', Field5, GetDate()
from View1

I understand there may be another syntax to run a stored procedure from access visual basic other than DoCmd. I would very much appreciate guidance as to how to do this.

Thank you.

View Replies !
Passing Parameters To A Stored Procedure In Visual Basic
Hi peeps,

I need some help with passing parameters to a stored procedure from my visual basic code.

Unfortunately im a bit of a novice with Visual basic and therefore have very little experience with it.

I have written a stored procedure in VS 2005 which when executed from the server explorer appears to retrieve the results that I require. However I am at a loss for how to actually call this procedure from my visual basic code.

The stored procedure is fairly simple requiring 5 colums from 2 tables. The procedure requires a single parameter to be passed to it.

The code for the procedure is listed below:


/*

Name: usp_display_all_users

Description: Displays activeuser, personid, comment from table: pswds

Userid and sort from table: people

Where the username is like the parameter supplied.

Both tables joined on personid

Author: Iain Blackwood

Modification log: Change

Description Date Changed by

Created proc 02/01/07 Iain Blackwood

*/

ALTER PROCEDURE usp_display_all_users

(

@searchStr nvarchar(128) =''

)

AS

SELECT dbo.pswds.activeuser, dbo.pswds.personid, dbo.people.userid, dbo.people.sort, dbo.pswds.comment

FROM dbo.pswds INNER JOIN

dbo.people ON dbo.pswds.personid = dbo.people.personid

WHERE (dbo.people.sort LIKE @searchStr + '%')

ORDER BY dbo.people.sort

 

The Visual Basic application I am working on firstly requires login details from the user to build a connection string for the SqlConnection. Once these vaules have been succesfully retrieved the application should display a view with the data returned by the stored procedure (in this case the stored procedure should use the default input parameter value of an empty string to return every row of data from the tables). However I also require that the stored procedure be called if the user enters a search string into the relevant textbox.

I have managed to reproduce the view I require with the following code however this is using SQL commands passed directly to the an SqlDataAdapter and not by calling the Stored procedure that i have written.

Private Sub fillDataGrid()


' I NEED TO:

' 1: Fill the data set with all Accounts

' 2: Diplay the Data to the data grid

' delcare a new SQL connection

sqlCon = New SqlConnection(conStr)

' Delcare and build the SQL Command String: WILL BE REPLACED BY STORED PROCEDURE

Dim comStrPeople As String = "SELECT pswds.activeuser, pswds.personid, userid, sort, pswds.comment"

comStrPeople += " FROM pswds INNER JOIN"

comStrPeople += " people ON pswds.personid = people.personid"

comStrPeople += " ORDER BY sort"

' Display the command string: TEMPOARY

testlbl2.Text = comStrPeople

' Declare a new SQL data adapter

sqlDataAdapter1 = New SqlDataAdapter(comStrPeople, sqlCon)

Try


' Declare a new dataset

sqlDataSet = New DataSet

' fill the sql data adapter with data from dataset: called PeoplePswds

sqlDataAdapter1.Fill(sqlDataSet, "PeoplePswds")

' Fill the forms datagrid view with data from the Dataset table PeoplePswds

DataGrid1.DataSource = sqlDataSet.Tables("PeoplePswds").DefaultView

Catch ex As Exception


' Display suitable error message

MessageBox.Show("Unable to retrieve Account Data at sub fillDataGrid" + ex.Message)

End Try

End Sub

 

I Guess what im asking for is someone to show / help with how the stored procedure is called from the visual basic code and passed the parameter/s required.

Thanx Flakkie

View Replies !
How Can I Connect A Sql Server Database To Visual Basic 2005 Express
Hi, i am new to sql server and visual basic, i need to connect my sql server database to a new application i've developed in visual basic 2005 express. Can any one tell me the steps to do this. Many Thanks.

View Replies !
Visual Basic Slow Down Sql Server 2000 Running A Stored Procedure
I hav the following problem. I have written an stored procedure in sql server 2000 as the following
CREATE PROCEDURE dbo.pa_rellena
    @pFechaInicio datetime
   
 AS
    declare @pFechaFin datetime
    declare @auxcod_cen char(10)
   
    declare @importeEfectivo decimal(17,2)
    declare @importeTarjetas1 decimal(17,2)
    declare @importeTarjetas2 decimal(17,2)
    declare @importeVales decimal(17,2)
    declare @importeTalones decimal(17,2)
    declare @importeGastos decimal(17,2)
   

    select @pFechaFin=@pFechaInicio+1
   

    --Borramos las tablas temporales si las hemos creado con anterioridad y no se han borrado
    if object_id('tmpCentros') is not null
        drop table tmpCentros

    if object_id('tmpCentros2') is not null
        drop table tmpCentros2

    if object_id('tmpMaxCajas') is not null
        drop table tmpMaxCajas

    if object_id('tmpCajasCentro') is not null
        drop table tmpCajasCentro
   
    if object_id('tmpVales') is not null
        drop table tmpVales

    if object_id('tmpDiarioEfectivo') is not null
        drop table tmpDiarioEfectivo
   
    if object_id('tmpDiarioTalones') is not null
        drop table tmpDiarioTalones
   
    if object_id('tmpDiarioTarjetas') is not null
        drop table tmpDiarioTarjetas

    if object_id('tmpDiarioSegundaForma') is not null
        drop table tmpDiarioSegundaForma

    if object_id('tmpDiarioGastosTarjetas') is not null
        drop table tmpDiarioGastosTarjetas

    if object_id('temp1') is not null
        drop table temp1

    --Seleccionamos todos los centros de Salvador Bachiller
    select * into tmpCentros2
         from centros
         where centros.tienda=1
        order by cod_cen
   
    --Seleccionamos el maximo de cajas por cada centro
   
    select cod_cen, max(cod_caja) as cajas into tmpMaxCajas
         from cierrecaja
        where fecha>=@pFechaInicio  and fecha<@pFechaFin 
        group by cod_cen
        order by cod_cen

    --Mezclamos los centros con el maximo de cajas
    select c.cod_cen, c.Centro, c.Direccion, c.localidad, c.provincia, c.cpostal, c.telefono, m.cajas, operaciones, cajas_tot, tienda, franquicia into tmpCentros
        from tmpCentros2 as c left outer join tmpMaxCajas as m on c.cod_cen=m.cod_cen
   
    --Cajas por centro
    select distinct cod_cen as cod_cen, cod_caja as cod_caja into tmpCajasCentro
        from cierrecaja
        where fecha>=@pFechaInicio and fecha<@pFechaFin
   
    --Los vales de cada centro
    select cod_cen,sum(importe) as imp1 into tmpVales
         from vales where
         fecha>=@pFechaInicio and fecha<@pFechaFin
         group by cod_cen

    --Efectivo de cada centro
    select cod_cen,'01' as vendedor,'EFECTIVO' as descripcion, (sum(diario.TotEuro)-Sum(Diario.Imppa2)) as importe1,0 as exp1, (sum(Diario.TotEuro)-sum(Diario.imppa2)) as importe2 into tmpDiarioEfectivo
        from diario
         where fecha>=@pFechaInicio and fecha<@pFechaFin and cod_cen in (select cod_cen from tmpCentros) and cod_caja in (select cod_caja from tmpCajasCentro) and diario.cod_pago='01'
        group by cod_cen

    --Talones por centro
    select centros.cod_cen,'02' as vendedor,'TALONES' as descripcion, sum(diario.TotEuro) as importe1,0 as exp1, sum(Diario.TotEuro) as importe2 into tmpDiarioTalones
        from centros  inner  join diario on centros.cod_cen=diario.cod_cen
         where fecha>=@pFechaInicio and fecha<@pFechaFin and diario.cod_cen in (select cod_cen from tmpCentros) and cod_caja in (select cod_caja from tmpCajasCentro) and  diario.cod_pago='02'
        group by centros.cod_cen

    --Tarjetas por centro
    select cod_cen,'03' as vendedor,'TARJETAS' as descripcion, sum(diario.TotEuro) as importe1,0 as exp1, sum(Diario.TotEuro*(FPago.Descuento/100)) as importe2, sum(Diario.TotEuro) - sum(Diario.TotEuro*(FPago.Descuento/100)) as importe3 into tmpDiarioTarjetas
        from FPago left join Diario  on fpago.Cod_pago=Diario.cod_pago
         where fecha>=@pFechaInicio and fecha<@pFechaFin and cod_cen in (select cod_cen from tmpCentros) and cod_caja in (select cod_caja from tmpCajasCentro) and Fpago.Descuento<>0
        group by cod_cen

    --Segunda Froma de Pago
    select cod_cen,'03' as vendedor,'TARJETAS' as descripcion,sum(diario.imppa2) as importe1 into tmpDiarioSegundaForma
         from fpago left join Diario on Fpago.cod_pago=diario.cod_pa1
        where fPago.cod_pago<>'99' and fecha>=@pfechaInicio and fecha<@pFechaFin and cod_cen in (select cod_cen from tmpCentros) and cod_caja in (select cod_caja from tmpCajasCentro) and Fpago.Descuento<>0
        group by cod_cen

    --Comisiones tarjetas de pago
    select cod_cen,'10' as vendedor, 'GASTOS (-)' as descripcion, sum(Diario.imppa2*(fPago.Descuento/100)) as importe2 into tmpDiarioGastosTarjetas
        from Fpago left join Diario on FPago.cod_pago= Diario.cod_pa1
        where fPago.cod_pago<>'99' and fecha>=@pFechaInicio and fecha<@pFechaFin and cod_cen in (select cod_cen from tmpCentros) and cod_caja in (select cod_caja from tmpCajasCentro) and Fpago.Descuento<>0
        group by cod_cen
/*
    --Venta neta por centro
    declare cursortemporal cursor for  select cod_cen from TmpCentros2
   
    open cursortemporal
    delete detallecaja_aux
    fetch next from cursortemporal into @auxcod_cen
    while @@fetch_status=0
        Begin
            select @importeVales=imp1 from tmpVales where cod_cen=@auxcod_Cen
            select @importeEfectivo=importe2  from tmpDiarioEfectivo where cod_cen=@auxcod_Cen
            select @importeTalones=importe2 from tmpDiarioTalones where cod_cen=@auxcod_cen
            select @importeTarjetas1=importe3 from tmpDiarioTarjetas where cod_cen=@auxcod_cen
            select @importeTarjetas2=importe1 from tmpDiarioSegundaForma where cod_cen=@auxcod_cen
            select @importeGastos=importe2 from tmpDiarioGastosTarjetas where cod_cen=@auxcod_cen

            select @importeVales=isnull(@importeVales,0)
            select @importeEfectivo=isnull(@importeEfectivo,0)
            select @importeTalones=isnull(@importeTalones,0)
            select @importeTarjetas1=isnull(@importeTarjetas1,0)
            select @importeTarjetas2=isnull(@importeTarjetas2,0)
            select @importeGastos=isnull(@importeGastos,0)
           
            print @auxcod_cen
            print @importeVales
            print @importeEfectivo
            print @importeTalones
            print @importeTarjetas1
            print @importeTarjetas2
            print @importeGastos

            insert into detallecaja_aux (cod_cen,importe1)
                values(@auxcod_cen, @importeVales+@importeEfectivo+@ImporteTalones+@ImporteTarjetas1+@importeTarjetas2-@importeGastos)
            fetch next from cursortemporal into @auxcod_cen
           
            select @importeVales=0
            select @importeEfectivo=0
            select @importeTalones=0
            select @importeTarjetas1=0
            select @importeTarjetas2=0
            select @importeGastos=0
        end
           
    close cursortemporal
*/
    select * from detallecaja_aux
GO

When I try to run it from visual basic it slow down the sql server.

What can I do?

View Replies !
Stored Procedure Not Returning OUTPUT Parameters To Visual Basic Program
I have coded a stored procedure to return nearly all of the columns of a single record selected by using a unique key value.  The record is in an SQL database, not within an in-memory DataSet.  All of the parameters that I wish to have returned to my program are defined as OUTPUT; the two key values are defaulted to INPUT, as there is no need to return them to the calling program.  I also have defined the direction of these parameters in the calling SQLDataAdapter function.  However, when I run this, the values returned are either the current date for my DateTime parameters, Nothing for my Char parameters or 0's for my integer parameters.

When I try testing the sproc alone, by using the "Step Into Stored Procedure" action in Visual Studio, I get a message in the Debug Output window indicating that parameter @TktClassID was expected and not supplied.  This is an OUTPUT parameter, which makes me question why I should be providing any sort of value for it within my VB code.  Following are the function definition from my SQLDataAdapter class that calls my sproc, and the sproc itself.  I appreciate any help that anyone can provide.


**FUNCTION DEFINITION FROM SQLDataAdapter Class

Public Function Fetch(ByVal ticket As Ticket) As Ticket
    Dim connbuilder As New System.Data.SqlClient.SqlConnectionStringBuilder
    connbuilder("Data Source") = "ITS-KCGV7VZSQLEXPRESS"
    connbuilder("Integrated Security") = "True"
    connbuilder("Initial Catalog") = "ITSHelpDesk"
    Using conn As New System.Data.SqlClient.SqlConnection(connbuilder.ConnectionString)

        Using comm As New System.Data.SqlClient.SqlCommand("dbo.TicketFetch", conn)
            conn.Open()
            comm.CommandType = CommandType.StoredProcedure
            Dim parm As System.Data.SqlClient.SqlParameter

        'Add Input parameters (i.e. Key values)

            'Add @TicketYear parameter
            parm = comm.Parameters.Add("@TicketYear", SqlDbType.SmallInt)
            parm.Value = DBNull.Value
            parm.Direction = ParameterDirection.Input
            'Add @TicketID parameter
            parm = comm.Parameters.Add("@TicketID", SqlDbType.Int)
            parm.Value = DBNull.Value
            parm.Direction = ParameterDirection.Input

        'Add Output parameters

            'Add @TktClassID parameter
            parm = comm.Parameters.Add("@TktClassID", SqlDbType.SmallInt)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.TktClassID
            'Add @TktRequestTypeID parameter
            parm = comm.Parameters.Add("@TktRequestTypeID", SqlDbType.SmallInt)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.TktRequestTypeID
            'Add @DateOpened parameter
            parm = comm.Parameters.Add("@DateOpened", SqlDbType.DateTime)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.DateOpened
            'Add @DateClosed parameter
            parm = comm.Parameters.Add("@DateClosed", SqlDbType.DateTime)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.DateClosed
            'Add @DateLastAssigned parameter
            parm = comm.Parameters.Add("@DateLastAssigned", SqlDbType.DateTime)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.DateLastAssigned
            'Add @DateLastStatusChange parameter
            parm = comm.Parameters.Add("@DateLastStatusChange", SqlDbType.DateTime)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.DateLastStatusChange
            'Add @TktStatus parameter
            parm = comm.Parameters.Add("@TktStatusID", SqlDbType.SmallInt)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.TktStatusID
            'Add @DescrRequest parameter
            parm = comm.Parameters.Add("@DescrRequest", SqlDbType.VarChar)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.DescrRequest
            'Add @DescrResolution parameter
            parm = comm.Parameters.Add("@DescrResolution", SqlDbType.VarChar)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.DescrResolution
            parm.Value = " " 'Handle bug?
            'Add @OpenStatus parameter
            parm = comm.Parameters.Add("@OpenStatus", SqlDbType.Bit)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.OpenStatus
            'Add @UserLastUpdate parameter
            parm = comm.Parameters.Add("@UserLastUpdate", SqlDbType.Char)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.UserLastUpdate
           'Add @DateLastUpdate parameter
            parm = comm.Parameters.Add("@DateLastUpdate", SqlDbType.DateTime)
            parm.Direction = ParameterDirection.Output
            parm.SourceColumn = ticket.DateLastUpdate
            comm.ExecuteNonQuery()
        End Using
    End Using

    Return ticket

End Function


**STORED PROCEDURE DEFINITION

USE [ITSHelpDesk]
GO
/****** Object:  StoredProcedure [dbo].[TicketFetch]    Script Date: 03/24/2008 08:40:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  Tim Peters
-- Create date: 3/17/2008
-- Description: Fetch Ticket from Ticket table
-- =============================================
ALTER PROCEDURE [dbo].[TicketFetch]
 -- Add the parameters for the stored procedure here
 @TicketYear smallint  = 0,
 @TicketID int = 0,
 @TktClassID smallint = NULL OUTPUT,
 @TktRequestTypeID smallint = NULL OUTPUT,
 @DateOpened datetime = NULL OUTPUT,
 @DateClosed datetime = NULL OUTPUT,
 @DateLastAssigned datetime = NULL OUTPUT,
 @DateLastStatusChange datetime = NULL OUTPUT,
 @TktStatusID smallint = NULL OUTPUT,
 @DescrRequest varchar(500) = NULL OUTPUT,
 @DescrResolution varchar(500) = NULL OUTPUT,
 @OpenStatus bit = NULL OUTPUT,
 @UserLastUpdate char(10) = NULL OUTPUT,
 @DateLastUpdate datetime = NULL OUTPUT
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

    -- Insert statements for procedure here
 SELECT
   @TktClassID = [TktClassID],
   @TktRequestTypeID = [TktRequestTypeID],
   @DateOpened = [DateOpened],
   @DateClosed = [DateClosed],
   @DateLastAssigned = [DateLastAssigned],
   @DateLastStatusChange = [DateLastStatusChange],
   @TktStatusID = [TktStatusID],
   @DescrRequest = [DescrRequest],
   @DescrResolution = [DescrResolution],
   @OpenStatus = [OpenStatus],
   @UserLastUpdate = [UserLastUpdate],
   @DateLastUpdate = [DateLastUpdate]
 FROM [dbo].[Ticket]
 WHERE [TicketYear] = @TicketYear AND [TicketID] = @TicketID
END
RETURN


 
 

View Replies !
SQL Server 2005 - Studio Express Vs. Visual Studio 2005 Install
I'm very confused.  I installed Visual Studio 2005 and thought I understood that SQL Server 2005 came with it, but it appears that it's SQL Server 2005 - Express.  Can anyone tell me what I need to do in order to get Data Transformation Services loaded or the equivalent of DTS in SQL Express? 
 
 

View Replies !
How To Use Xcopy && User Instance To Copy 3 Dbo Tables From The Database Of SQL Server Management Studio Express To The App_Data Folder Of Website Of VWD Express Project?
Hi all,
I have read/studied (i) Working with Databases in Visual Web Developer 2005 Express in http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/vwd.aspx, (ii) Xcopy Deployment (SQL Server Express) in http://msdn2.microsoft.com/en-us/library/ms165716.aspx, (iii) User Instances for Non-Administrators in http://msdn2.microsoft.com/en-us/library/ms143684.aspx, and (iv) Embedding SQL Server Server Express in Applications in http://msdn2.microsoft.com/en-us/library/ms165660.aspx.  I do not understand the concepts and procedures to do Xcopy and User Instances for non-administrators completely-I do not know how to connect to databases and create database diagrams or schemas using the Database Explorer.  I have a stand-alone Windows XP Pro PC. I have created a ChemDatabase with 3 dbo tables in the SQL Server Management Studio of my SQL Server Express and a website of my VWD Express application with an App_Data folder.  I am not able to proceed to use Xcopy and user instance to bring the 3 dbo tables of ChemDatabase to my App_Data folder. Please help and give me some detailed procedures/instructions to bring the 3 dbo tables of ChemDatabase (or ChemDatabase itself) from the SQL Server Management Studio Express to the App_Data folder of the website of my VWD Express project? 
Thanks in advance,
Scott Chang 
 

View Replies !
Adding, Deleting Rows From Visual Basic 2005 Express Edition
 

Hi,

 

I'm a complete novice concerning SQL Server (Express Edition)

I'm trying to Add or Delete rows froma VB 2005 Express Function or Sub. While the program is running everything is ok. Except when restarted added records are gone and deleted records are back.

 

Have i missed an option during installation?

 

Thx,

Steven

View Replies !
How Can I See My Databases In Management Studio Express, As A Limited User?
 I installed SQL Server 2005 Express, and Management Studio Express, while logged on as an Administrator of my XP Pro machine.  When I switch to my limited user account, Management Studio Express seems not to be aware that SQL Server is even running on the machine (although Configuration Manager can see it and reports that it is running).  I'm sure I've missed something simple, but I can't find the answer anywhere... how can I get access to my local SQL Server from my limited user account?

View Replies !
Can A Non-administrator User Run The SQL Server Management Studio Express ?
If i install the SQL Server Express and the Management Studio in my computer with an administrator account... can a non-administrator user run the SQL Server Management Studio Express ?

When the non-administrator user tries run the SSEMS, he gets an error, something like  "Cannot load the SQL Management Studio Package".

Can i set several permissions to let non-administrator users run the SSEMS ?

View Replies !
Cannot Log Into SQL Server Database In Visual C# Express After Using SQL Server Management Studio Express
Is anyone else having the same annoying problem as me? ...

 

I have a SQL Server Express edition database using Windows login authentication. Normally I can access it fine in C# Express, but If I have used SQL Server management Studio express in the same windows login session, i get:

 

Cannot open user default database. Login failed.

Login failed for user 'mydomainmyuserid'

 

If I restart my PC, I can then access the database in Visual C# express.

 

I'm running Windows XP.

 

Thanks!

View Replies !
Creating A User In SQLExpress With SQL Server Management Studio Express
I have created a user in SQL Server Management Studio Express. However,

View Replies !
SQL Database User Account Access Remotely Via SQL Management Studio Express
Hi, I hope you can help.I have configured a Windows 2003 web server and SQL 2005 Server (on same box) to successfully allow remote connections and to allow access via SQL Server Management Studio Express 2005.The problem I have is that I want to restrict access to the databases on the server via the Management Studio to specific databases e.g. 1 database user "sees" only 1 database.I can configure it so that the user's remote  access permissions do not allow access to other databases but they can still "see" the database listed in the Management Studio explorer.I can also configure it so that the users cannot see all the databases (by disabling View All Databases on SQL Server), but this means that they cannot not see their own database which they have permissions for.Is it impossible to have the desired behaviour of only displaying the database which the remote user accessing has permissions for and hiding all other databases?I have MSN'd,Googled and Yahoo'd this one to no avail :(Many thanksFergus 

View Replies !
Debug Stored Procedure Using Visual Studio.NET
I am trying to debug a stored procedure following the instruction at:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;316549.


But when I set the breakpoint in the stored procedure and run the web app, the breakpoint has little white question mark when I mouse over the break point I get this message:

"The breakpoint will not currently be hit. Unable to bind SQL breakpoint at this time. Object containing the breakpoint not loaded."

Has anyone been able do this successfully?

View Replies !
Visual Studio Step Into Stored Procedure
Hi,

I have been developing a web application on Visual Studio 2003.NET and MSSQL2005 Developer Edition for some time without problem. Then suddenly today (and for no apparent reason that I am aware of), I lost the ability to step into stored procedures. I get a message saying I do not have permission to run master.sp_sdidebug.

I cannot even find this stored procedure - doesn anyone know where it might live or how to reinstall it?

Also, does anyone know what user Visual Studio uses when it is talking to MSSQL?

Any help would be most appreciated.

Best wishes, Patrick Skelton

View Replies !
Sql Express SP2 And Visual Studio 2005
Will the SQL Express SP2 update the Installer package that comes with Visual Studio 2005 so that SQL Express SP2 is included with a ClickOnce or MSI based installer?

Including SP2 on Windows Update is a step in the right direction, but I (and I assume others) really hate the idea of burdening our users with the additional step of obtaining the SP2 update immediately after installing our application. This is especially cumbersome if they are using dial-up Internet connections which, unfortunately, many of our customers continue to use.

Thanks,
Travis

View Replies !
Stored Procedure - User Defined Function.
Hi.I'm really new to MSSQL, so therefore my question can sound stupid.Is it possible to use a function written in a module in MS-ACCESS in astored procedure?Or how can it be done, it is a complicated function with loop and more.I'll appreciate all answers also negatives ones.TIAJørn

View Replies !
User-Defined-Function With-in Stored-Procedure??
Does MS-SQL allow us to create an user-defined function within the stored-procedure script? I have been getting errors. It's my first time using the user-defined function with stored-procedure. I welcome your help.


Code:


CREATE FUNCTION ftnVehicleYearFormattor (@sValue VARCHAR(2))
RETURNS VARCHAR(2)
AS
BEGIN
IF (LEN(@sValue) < 2)
SET @sValue = '0' + @sValue

RETURN @sValue
END



Thanks...

View Replies !
How To Use User Defined Function In Stored Procedure?
Hello friends,

           I want to use my user defined function in a stored procedure.

I have used it like ,

select statement where id = dbo.getid(1,1,'abc')

//dbo.getid is a user defined function.



procedure is created successfully but when i run it by exec procedurename parameter



I get error that says

"Cannot find either column "dbo" or the user-defined function or aggregate "dbo.getid", or the name is ambiguous."


Can any body help me?



Rgds,

Kiran.

View Replies !
Stored Procedure Vs User Defined Functions
Hi All,

My question is :

Why we are using udf inside stored procedures ?
Will it make any performance faster for the stored procedure to execute ?

awaiting your reply.

Thanks
Renjith

View Replies !
Stored Procedure And User-Defined Functions
lokesh writes "1) What are the differences between "Stored Procedure" and "User-Defined Functions"?

2) Places where we use/don't use Stored Procedure/User-Defined Functions."

View Replies !
Restoring A Sql 2000 Db In Sql 2005 Express Db With Sql Server Management Studio Express
As I said in the subject I've a problem trying to restore a backup of a previous db created in sql 2000 server

When I try to do it I recive the following message:

____________________________________________________________________________________
System.Data.SqlClient.SqlError: Il set di backup include il backup di un database diverso dal database 'musica2007' esistente. (Microsoft.SqlServer.Express.Smo)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476

------------------------------
Program Location:

   in Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages)
   in Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
   in Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)
____________________________________________________________________________________

What should I do? What's the probem? I've already tried to look for the solution in other messages but I didn't find anything..... Thanks for help,,, by Luke

View Replies !
Can't Connect To SQL 2005 Express With SQL Server Management Studio Express
I've seen the following error posted when people try to connect to their server via their applications but didn't see anyone having problems when trying to connect with SQL Server Management Studio Express. Am I missing something here? This is the error:<<An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)(Microsoft SQL Server, Error: 2)>>The server is not remote so I don't see why I need to enable remote connection. I am also using the default connection settings.

View Replies !
MS SQL Server Management Studio Express (2005) Express Edition
Hello,

I am trying to "import" a .dbf into SQL Server Compact Edition, but I cannot find a way to do so. Can someone tell me how this is done?

View Replies !
Cannot Connect To SQL Server 2005 Express With Management Studio Express
On my home machine without permanent network connections enabled, I cannot get the Management Studio connect to the database server.  Always get this error:

 

Cannot connect ot MPLIAMSQLEXPRESS

Additional Information:
 
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, erro: 26 - Error Locating Server/Instance Specified)(Microsoft SQL Server)

 

I have used the SQL Surface Area Configuration Tool to reset the defaults to allow remote connections, stopped and restarted the server, but still get the same message.

Please help.

View Replies !
Northwind Database In SQL Server Management Studio Express Is Lost Or Used/processed By VB 2005 Express:How To Locate/return It
Hi all,
 
In the last one and half years, I used the Northwind Database in SQL Server Management Studio Express (SSMSE) to learn the programming of SqlConnections, Data sources, Database Exploere, ADO.NET 2.0, etc. via VB 2005 Express. 

The Northwind Database in my SSMSE got lost very often, but I was not aware of it.  How can I know where the Northwind Database is used or processed by my VB 2005 Express projects that were the examples of some tutorial books or my trial projects? How can I release the Northwind Database back to my SSMSE from the VB 2005 Express projects?  Please help and advise.
 
Thanks in advance,
Scott Chang

View Replies !
Problem Debbuging A Stored Procedure In Visual Studio
Hello,I want to debug a Stored Procedure in the VIsual Studio. Actually I managed to do that, but only from Step into SP and Execute. I want to put a breakpoint in the procedure and when it is hit to stop, but if I Run(With Debug) my Site it doesn't stop at the  breakpoint in the SP. I put a mark in the project options to debug SQL. What can be wrong?

View Replies !
SQL Express 2005 With Visual Studio 2003
I am just starting to work with Visual Studio and SQL.  I have Visual Studion 2003 with .net Framework 1.1.  I want to download the SQL 2005 Express version and it requires the upgrade to .NET Framework 2.0

Will this affect my Visual Studio 2003?  And can I use SQL 2005 with Visual Studio 2003?

Any help would be appreciated.

Thanks,

 

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved