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

Thursday, March 29, 2012

Adding a step to CreateUserWizard

Hey all,

I'm working in Visual Web Developer 2005 Express. I'm a total newb so please bare with me. I'm trying to add a step to my CreateUserWizard that I put in using the automatic site administration utility. I've added a wizard step in between the "Sign up for your new account" step and the "complete" step. The purpose of the new step is to collect additional information about the user. I've added a FormView control and used an SQLDataSource to link it to a new table in the database established by the administration utility, and set up the templates to recieve the data.


The one kink in the process seems to be associating the UserID created in step one with the additional information submitted in step 2. I made a UserID column, of data type uniqueidetifier in my new table and set up a foreign key relationship with the UserID columns in the aspnet_Membership table and the aspnet_Users table. When I run it as is I get the following error after I try to insert the data entered in the second step (additional information) into my new database table:

Implicit conversion from data type sql_variant to uniqueidentifier is not allowed. Use the CONVERT function to run this query

I guess my question is:How do I take the UserID generated in step 1, and pass it into the new table and into the new row being created in step 2? If possible, I would like to do it without any code (haha probably not going to happen, but worth a shot) but any assistance anyone could offer would be greatly appreciated. Thanks everyone.

Matt Downey

You can grab the userID like this

Membership.GetUser(CreateUserWizard1.UserName).ProviderUserKey

where createuserwizard1 is the ID of the 1st step of your wizard.

Tuesday, March 27, 2012

Adding a new report to VS 2005

When I try to add a new Report to a Report Server project I get the
following error and I can't add it to project.
TITLE: Microsoft Visual Studio
--
Exception of type 'System.Runtime.InteropServices.COMException' was thrown.
--
BUTTONS:
OK
--
===================================
Exception of type 'System.Runtime.InteropServices.COMException' was thrown.
(Microsoft Visual Studio)
--
Program Location:
at
Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OnHierarchyNodeAppending(IHierarchyNode
node, IHierarchyNode parentNode)
at
Microsoft.DataWarehouse.VsIntegration.Hierarchy.Hierarchy.Add(IHierarchyNode
node, IHierarchyNode parentNode)
at
Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.AddExistingFileToProject(IFileProjectNode&
parentNode, String name, String fullPath, VSADDITEMOPERATION
dwAddItemOperation)
at
Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectItemsExt.AddFromFile(String
FileName)
at
Microsoft.ReportDesigner.Wizards.ReportWizardForm.OnFinish(CancelEventArgs
e)Don't know if this is related. In the RTM, there are issues with the add
report wizzard. If you use the add item, then select report everything seems
to works ok.
"Sorin Sandu" wrote:
> When I try to add a new Report to a Report Server project I get the
> following error and I can't add it to project.
> TITLE: Microsoft Visual Studio
> --
> Exception of type 'System.Runtime.InteropServices.COMException' was thrown.
> --
> BUTTONS:
> OK
> --
> ===================================> Exception of type 'System.Runtime.InteropServices.COMException' was thrown.
> (Microsoft Visual Studio)
> --
> Program Location:
> at
> Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OnHierarchyNodeAppending(IHierarchyNode
> node, IHierarchyNode parentNode)
> at
> Microsoft.DataWarehouse.VsIntegration.Hierarchy.Hierarchy.Add(IHierarchyNode
> node, IHierarchyNode parentNode)
> at
> Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.AddExistingFileToProject(IFileProjectNode&
> parentNode, String name, String fullPath, VSADDITEMOPERATION
> dwAddItemOperation)
> at
> Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectItemsExt.AddFromFile(String
> FileName)
> at
> Microsoft.ReportDesigner.Wizards.ReportWizardForm.OnFinish(CancelEventArgs
> e)
>
>|||If I add a new item and select Report nothing happens !!!!
"Wickherm" <Wickherm@.discussions.microsoft.com> a scris în mesajul de
ºtiri:1C7124B2-4E9D-42D1-AABF-FFD029FC2276@.microsoft.com...
> Don't know if this is related. In the RTM, there are issues with the add
> report wizzard. If you use the add item, then select report everything
> seems
> to works ok.
> "Sorin Sandu" wrote:
>> When I try to add a new Report to a Report Server project I get the
>> following error and I can't add it to project.
>> TITLE: Microsoft Visual Studio
>> --
>> Exception of type 'System.Runtime.InteropServices.COMException' was
>> thrown.
>> --
>> BUTTONS:
>> OK
>> --
>> ===================================>> Exception of type 'System.Runtime.InteropServices.COMException' was
>> thrown.
>> (Microsoft Visual Studio)
>> --
>> Program Location:
>> at
>> Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.OnHierarchyNodeAppending(IHierarchyNode
>> node, IHierarchyNode parentNode)
>> at
>> Microsoft.DataWarehouse.VsIntegration.Hierarchy.Hierarchy.Add(IHierarchyNode
>> node, IHierarchyNode parentNode)
>> at
>> Microsoft.DataWarehouse.VsIntegration.Shell.Project.FileProjectHierarchy.AddExistingFileToProject(IFileProjectNode&
>> parentNode, String name, String fullPath, VSADDITEMOPERATION
>> dwAddItemOperation)
>> at
>> Microsoft.DataWarehouse.VsIntegration.Shell.Project.Extensibility.ProjectItemsExt.AddFromFile(String
>> FileName)
>> at
>> Microsoft.ReportDesigner.Wizards.ReportWizardForm.OnFinish(CancelEventArgs
>> e)
>>
>>

Sunday, March 25, 2012

Adding a Delete functionality to my Shopping Cart

Hello,

I'm in the progress of developing a shopping cart system that operates with an SQL database in Visual Web Developer 2005. I've managed to successfully add items to the cart and display them, but I'm having trouble providing the user with the option of removing items from the cart.

My understanding so far is that I've got to adjust the DELETE SQL statement of the data source. At first I was thinking along the lines of a simple statement:

DELETE * FROM ShoppingCart WHERE CartID=@.CartID AND CategoryID=@.CategoryID AND ProductID=@.ProductID

However, I've realised that the parameters I need for this SQL query aren't automatically passed in when a user clicks the "Delete" text of the Delete field (at least I think this is the problem).

The error message which I'm getting when I try to remove an item from the cart is as follows:

Incorrect syntax near '*'.

If anyone could let me know where I'm going wrong and point me in the right direction I'd be really grateful.

Thank you,

Luke

Hi Luke,

There should not be an asterisk (*) in your DELETE statement. If you remove that you might have better luck.|||

Thanks very much for your help - I thought it might have been a really stupid mistake like that! Anyway everything is working fine now.

Thanks again,

Luke

Adding a data connection in Visual Studio

Not sure if I should add this in this forum or in a VS forum, but here goes.

I have a Visual Studio project setup using VB.Net 2005 RTM. I have a SQL2000 data connection set up and it is working. We have just added a SQL2000 database that is on the same server as a named instance. When I go to add the 2000 SQL data connection all I can see is the name of the Server and the 2005 databases. Both the SQL2005 and the SQL2000 are on a box cleverly called SERVER. In the "Add Connection" dialog box I enter Server as the server name and then when I click on the dropdown for the databases I just see the SQL2005 database. The 2000 instance name is SQL2000 so I entered \\Server\SQL2000 as the server name but that didn't get me anything. Any suggestions?

Thanks...

To connect to a named instance, you specify the server name in the connection dialog as <servername>\<instancename>. So in your environment, you would enter SERVER\SQL2000. Remove the leading backslashes and you should be ok.

jeff.

Adding a data connection in Visual Studio

Not sure if I should add this in this forum or in a VS forum, but here goes.

I have a Visual Studio project setup using VB.Net 2005 RTM. I have a SQL2000 data connection set up and it is working. We have just added a SQL2000 database that is on the same server as a named instance. When I go to add the 2000 SQL data connection all I can see is the name of the Server and the 2005 databases. Both the SQL2005 and the SQL2000 are on a box cleverly called SERVER. In the "Add Connection" dialog box I enter Server as the server name and then when I click on the dropdown for the databases I just see the SQL2005 database. The 2000 instance name is SQL2000 so I entered \\Server\SQL2000 as the server name but that didn't get me anything. Any suggestions?

Thanks...

To connect to a named instance, you specify the server name in the connection dialog as <servername>\<instancename>. So in your environment, you would enter SERVER\SQL2000. Remove the leading backslashes and you should be ok.

jeff.

Adding a Connection in Visual C++ 2005 Express

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

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 default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

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 default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

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 default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

The error above sometimes happens when the instance name is incorrect, and the SqlClient provider infers that it is connecting to a SQL Server 2000 (even if none is installed).

Was the SQL Express installed as a named instance named "SQLEXPRESS" (which is the default case)?

You can verify this by opening a command windo and run

net start | findstr -i "sql"

You can verify the instance name used by the opening the "Advanced" tab in the "Add Connection" window.

It should match the instance name of the installed SQL Express.

|||I'm having the same problem connecting to SQL Server 2005 Express.

C:\net start | findstr -i "sql"
PostgreSQL Database Server 8.1
SQL Server (SQLEXPRESS)

/////////////////////////////////////////////////////////////////////

CDatabase dbDateServ;

dbDateServ.Open("ODBC; DSN=MyDSN; UID=myuid; PWD=mypass; DATABASE=mydatabase");

How do I determine the following:
1) How do I determine what the DSN is?
2) How do I determine what my UID is?
3 )How do I determine what my PWD is (or how to set it)?
4) Example database I can use within SQL Server 2005 express?

Adding a Connection in Visual C++ 2005 Express

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

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 default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

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 default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

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 default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

The error above sometimes happens when the instance name is incorrect, and the SqlClient provider infers that it is connecting to a SQL Server 2000 (even if none is installed).

Was the SQL Express installed as a named instance named "SQLEXPRESS" (which is the default case)?

You can verify this by opening a command windo and run

net start | findstr -i "sql"

You can verify the instance name used by the opening the "Advanced" tab in the "Add Connection" window.

It should match the instance name of the installed SQL Express.

|||I'm having the same problem connecting to SQL Server 2005 Express.

C:\net start | findstr -i "sql"
PostgreSQL Database Server 8.1
SQL Server (SQLEXPRESS)

/////////////////////////////////////////////////////////////////////

CDatabase dbDateServ;

dbDateServ.Open("ODBC; DSN=MyDSN; UID=myuid; PWD=mypass; DATABASE=mydatabase");

How do I determine the following:
1) How do I determine what the DSN is?
2) How do I determine what my UID is?
3 )How do I determine what my PWD is (or how to set it)?
4) Example database I can use within SQL Server 2005 express?

Sunday, March 11, 2012

Add sdf file to my project when my sources are on remote server

I have an application that runs on a PDA and manage a database (.sdf) file I use C# with visual studio 5.0.

What I want to do is to add the database file (.sdf) to my project files and open a connection to it.

The problem is that all my source file are stored on remote machine and not locally on my machine and the .sdf file is also stored with the project source files.

When I try to add the file to the project I get the following error fro the data source configuration wizard :

"An error occured while retrieving the information from the database"

DRIVE_REMOTE

Parameter Name : N:\

I get the same error also when I try to open a new connection to the file from the server explorer. When i copy the file to drive "C" I can open a connection to it with no errors.


Software engineer

Hello,

Remotely opening an sdf file (SSC database) is not supported. From desktop to device (DB on a device) access is possible, but, I don't think the other way is.

Thanks

Udaya.

Tuesday, March 6, 2012

Add new datasource C++ sqlexpress does not work

I have Visual C++ Express edition and SQL Express edition installed. When I try to add a datasource, the only two choices are Microsoft Access and SQL Server File. This SQL one does not work when I select it with an error that it was "Unable to open the physical file x.mdf. Operating system error 32: 32(The process cannot access the file because it is being used by another process.). An attempt to attach an auto-named database.... When I do my own

System::Data::SqlClient::SqlConnection ^ c0;

System::Data::SqlClient::SqlCommand ^ k0;

System::Data::SqlClient::SqlDataReader ^ r0;

things work fine. Do I need to get a $ edition, download something extra, connect to the a different file (master.mdf and not x.mdf), repair/reinstall, ...?

I would note that it destroyed my msde mdf in previous attempts before I decided to try only the sql express server as a datasource.

I haven't really used VC++ express, but I'll have a go at solving the problem. You shouldn't need to buy the $ edition of SQL Server, or download something extra. In the past when I've seen this error, it has either been to do with file permissions or another instance being attached to the file. Verify that the user you're currently logged on as has full permissions on the file you are trying to connect to.

If this doesn't help, maybe post the connection strings you are using up.

|||

For some reason I am not quite sure, when I tried to set up a datasource today after a reboot and not opening and debugging a project that had a manually written connection that worked, I was successful in getting the gui wizard to work.

Thanks.

Saturday, February 25, 2012

Add into 2 tables (VS 2005)

Hi, not sure if I've posted at the right area but here goes:

I'm working on a project using Visual Studio 2005 and SQL express server for the database.

Since I'm using VS 05, I use datasources to select, insert, delete, update from my db.

Question is, how do i insert, delete, update from 2 tables using datasource? is it even allowed?

If it's not allowed, are there any solutions other than using the codebehind?

Please help. Thank you.

hi galovesongs,

you can you any of these two solutions

1. on the vs.net

Making use of system.transaction

you can put two of your delete, insert, update inside a transaction

placing two statement in a transaction context

is the best way to go.

pls find a four page article on this link

http://www.devx.com/vb/Door/10608

2. on the database

you can make use of the trigger

i moved the thread here. for better opinions

Add Images to table of SQL Server 2005

Dear All,
How can I assign an image to an image-field in a SQL Server 2005
Express with the tooling of Microsoft (I have Visual Studio 2005 Team
edition). I cannot find a way.
Further I tried to write an small program with an DataGridView, but
here I can fill in all other fields except the image field. So how can
I get images in the database?
Thanks in advance, FrankSee if this helps:
http://support.microsoft.com/defaul...b;en-us;Q316887
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
<frank.van.der.schoot@.relitech.nl> wrote in message
news:1145355355.271404.288750@.t31g2000cwb.googlegroups.com...
> Dear All,
> How can I assign an image to an image-field in a SQL Server 2005
> Express with the tooling of Microsoft (I have Visual Studio 2005 Team
> edition). I cannot find a way.
> Further I tried to write an small program with an DataGridView, but
> here I can fill in all other fields except the image field. So how can
> I get images in the database?
> Thanks in advance, Frank
>

Friday, February 24, 2012

Add connection error: 40

Hi i just reinstalled windows, and installed visual studio .net 2005 and the Sql server.

But when im trying to add connection, select my computer at Server

name, type a databasename then pressing OK i get this message:

An error has occured while estabilishing a connection to the server.

When connection to SQL server 2005, this faliure may be caused by the

fact that under the default settings SQL Server does not allow remote

connections. (provider: Names pipes provider, error: 40 - Could not

open a connection to SQL Server)

Does anyone know what todo?

hermanTry this: open the SQL Server Configuration Manager, expand SQL Server 2005 Network Configuration, highlight protocols for MSSQLSERVER and enable TCIP/IP.

Mike

Thursday, February 16, 2012

Add a new data source to a SQL Server Compact Edition

I have installed SQL Server 2005 CE on my computer, but when I try to add a data connection to a CE database in Visual Studio 2005, I cannot find the option "SQL Server 2005 Combact Edition". Why?

Hi,

see this here: http://img366.imageshack.us/img366/555/untitledph0.jpg
-Jens.

|||I have the same issue. I install the SQL compact framework runtime, SDK, and VS2K5 components but the option is never listed in the potential data sources for any project. I can create as many SQL server, SQL server express, or Access databases as I want, but the option for the Compact Edition just isn't listed.|||Hi,

I face the exactly the same problem. Have anyone found the solution to this?
thanks.

regards,
TY|||Hi,

Finally i got the problem fixed. Seem like there are some name conflict within the VS2005 for the Mobile Edition and Compact Edition. Just need to install the VS2005 SP1 all those problem will automatic fixed.
thanks.

regards,
Tze Yang

Add a new data source to a SQL Server Compact Edition

I have installed SQL Server 2005 CE on my computer, but when I try to add a data connection to a CE database in Visual Studio 2005, I cannot find the option "SQL Server 2005 Combact Edition". Why?

Hi,

see this here: http://img366.imageshack.us/img366/555/untitledph0.jpg
-Jens.

|||I have the same issue. I install the SQL compact framework runtime, SDK, and VS2K5 components but the option is never listed in the potential data sources for any project. I can create as many SQL server, SQL server express, or Access databases as I want, but the option for the Compact Edition just isn't listed.|||Hi,

I face the exactly the same problem. Have anyone found the solution to this?
thanks.

regards,
TY
|||Hi,

Finally i got the problem fixed. Seem like there are some name conflict within the VS2005 for the Mobile Edition and Compact Edition. Just need to install the VS2005 SP1 all those problem will automatic fixed.
thanks.

regards,
Tze Yang

Sunday, February 12, 2012

Ad hoc report with Visual Web Developer 2005 Express?

Hi. I use Visual Web Developer 2005 Express (hereafter VWD) with the
the MS Reporting Services Add-in. I've successfully created a report
using this service. But the SQL query I used was pre-defined.
I am wondering if this add-in with VWD lets us do ad hoc reports. For
example, let the end user select from a list of available fields and
set the condition criteria.
Any hint? Thx.Why to reinvent the wheel, whatever you thought of doing is already there in
Report Builder so make use of it.
Provided you have SS2005. If not possibly you can go for one.
Amarnath
"antonyliu2002@.yahoo.com" wrote:
> Hi. I use Visual Web Developer 2005 Express (hereafter VWD) with the
> the MS Reporting Services Add-in. I've successfully created a report
> using this service. But the SQL query I used was pre-defined.
> I am wondering if this add-in with VWD lets us do ad hoc reports. For
> example, let the end user select from a list of available fields and
> set the condition criteria.
> Any hint? Thx.
>