Showing posts with label vs2005. Show all posts
Showing posts with label vs2005. Show all posts

Monday, March 19, 2012

Can't see Designer view in Asp.net 2005

Hi All,

I am using VS2005 Trial version, In my website project i can't able to see Designer View of all .aspx files but i can able to view code part. Earlier days i can able to see Designer page but now i can't do why? This problem occurs even new website project also.

Can any one help me?

Thanks in advance

Regards

Nat Raja

This forum is dedicated to SQL/e, not to ASP.Net. Please post to relevant forum or news group instead:

http://forums.asp.net/

http://support.microsoft.com/newsgroups/default.aspx

Closing as off topic.

Cant save my stored procedure using VS2005

Hi!

I'm using VS2005 and trying to save my very simple stored procedure.
The error message "Invalid object name 'dbo.xxxxx' just pop's up.

The SP is written through the Server Explorer > Stored Procedures > Add new... etc.
Using SQL server 2000.

Don't think this has to do with the SP-code but here it is:

ALTER PROCEDUREdbo.KontrollUnikPersNr
@.PersNrnvarchar(50) =null OUTPUT
AS
SELECT@.PersNr = PersNrFROMUserWHEREPersNr = @.PersNr
RETURN@.@.ROWCOUNT

Thanx i advance for any help!

Looks like you are trying to ALTER a proc that does not exist. Try changing the ALTER to CREATE and see if it helps.

Also, I dont understand what you are trying to return from the stored proc - the rowcount or the value from the database?

|||

Thanx a lot!

I changed the Alter to Create and it works... didn't have to think of the in VS2003.

I'm returning the rowcount to see if there is any Users with the specific values that has to be unique in my user database table.

Thanks a lot again!Smile

|||

If you just need the count you could do it like this:

ALTER PROCEDURE dbo.KontrollUnikPersNr@.PersNrvarchar(50) =NULL,@.countint OUTPUTASBEGINSET NOCOUNT ONSELECT @.count =count(*)FROMUserWHERE PersNr = @.PersNrSET NOCOUNT OFFEND

|||

Hm, did'nt think of that... nice.

Thanx a lot again... let me know if I can help you with any tricky stuff.. erhm... Wink

Friday, February 10, 2012

Cant get SQL Express Installed

Hi-

I had previously had VS2005 Beta installed from my MSDN discs. When it expired, I uninstalled it and downloaded VWD Express to install. VWD installed fine, but the SQL Server Express will not install. The VWD install package doesn't give me any feedback, just says it failed. I tried dowloading and installing SQL Express separately, and it tells me that I have to uninstall all components from other versions. I have done that, but still wont install. If I use the uninstall utility on the website, it tells me it can't find any components, and all of the components listed in the manual uninstall instructions are missing, so I can't find anything further to uninstall. (FYI: I'm running XP Pro SP2).

I'm wondering if a registry setting or something didn't get updated on uninstall. I see a registry folder for "Microsoft SQL Server" but I do not know if this could be getting in the way.

Any help would be appreciated.

-Moz

I guess the issue is caused by imcompletely uninstalled VS2005 beta components. You can find SQL Server setup logs under the "%ProgramFiles%\Microsoft SQL Server\90\Setup\Bootstrap\LOG\Files" folder. However the logs are always verbose to read. So it may be better to uninstall all existing VS2005 components completely, please refer to this article:

http://msdn.microsoft.com/vstudio/support/uninstall/default.aspx

|||

Yeah, I followed the uninstall instructions, but none of the programs to uninstall are in my list. I looked at the logs (thanx for the lead on that) and it appears that the errors are thrown when it loads the msi.dll. The errors in the log indicate that it's finding incompatible versions of the following:

Microsoft SQL Server 2005 CTP|||

I got this straightened out. Nothing was working, but I stumbled on this:

http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx

and the steps and tools he provided did the necessary clean up for me, after which I was able to get the express edition installed.

Thanx for the help!

-Moz

Can't Get SQL Authentication to work With XP Pro SP2 in very simple test case

I'm trying to work my way through the steps of using a User Id and Password in a connection string.

I'm working with SQL 2005 Express, VS2005, in the development server. Got an error I can't get around...tried it several diffent ways on a slightly more complicated test site...no joy...so went to the MSDN tutorial...made the most "vanilla" test I could think of, and still can't figure it out.

I thought it would be simple enough that I could post the whole thing (below)

The test works fine with Integrated Security = True in the connection string. When I remove that phrase, I get the error:

{"CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file E:\MyPath\App_Data\VSST_DB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."}

This occurs on the cn.Open statement below.

It gets past the login, so I know that the SQL User and password match up correctly.

==========================
<connectionStrings>
<add name="VSST_CN"
connectionString="Data Source=MyServer\SQLEXPRESS;AttachDbFilename=E:\MyPath\App_Data\VSST_DB.mdf;User Id = VSST; Password=vsst123"
providerName="System.Data.SqlClient"/>
</connectionStrings>

=========================
Page Code Behind (no controls on page)

Imports System.Data
Imports System.Data.SqlClient

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim cn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("VSST_CN").ToString())

Dim cmd As SqlCommand = New SqlCommand("SELECT COUNT(*) FROM VSST_Table", cn)
cn.Open()
Dim rdr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
rdr.Read()
Response.Write(rdr(0).ToString())


End Sub
End Class


=================
The DB

Table VSST_Table,
ID is int, primary key, identity
Field1, Field2, Field3, Field4, Field5 are varchar(50)

I added one record ("A", "B", "C", "D", "E") to the table through VS2005 Server Explorer

This shows up in Count = 1 from running the page when Integrated Security = True

=================
In SSMSE: (this is ALL I did, tried to use the minimum so not to confuse...)

I added the SQL Authentication Server level user "VSST" with the password "vsst123" (and the login works, as noted above)

I attach the .mdf

I add VSST to the Database Users, and give it db_owner

I add VSST to the Table with all permissions checked.

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

I can't figure this out. This is a very vanilla test and I'm stumped. I'm about to give up on SQL Authentication entirely (at least for now), and just try to filter my inputs for SQL Injections...that's the only reason I have (at this stage in my biz plan) for needing SQL Authentication. On the other hand, I really don't like being this stumped on something that is so widely promoted as a common practice.

Any help on this would be greatly appreciated.

Thanks!

It's an XP SP2 security issue. The connect is running within an application sandbox which is not granted the authority to attach, create, or restore a database. The integrated security scenario works, because the Windows credentials are passed through. We spent days trying to figure a way around this one when dealing with a click once application installation and finally gave up. There wasn't a single permutation that we could use to get around the security restrictions that XP SP2 put in place. If the database already existed, everything connected and worked just fine. But, it simply refused to attach a database.|||

Thanks for the input. Wow. Good to know I wasn't completely blowing it....it looked too easy.

So, maybe it will work on the Windows 2003 VPS Server I'm renting...I guess I'll have to give it a try. But maybe it tells me I need to consider why SQL Authentication is critical to this app.

Grazie!

|||

I think there was something in the decision tree that I missed...

As I am gradually putting this together, it looks like the first choice is "1 server => windows authentication" vs "multiple servers (plus some other cases) => sql authentication"

After that, everything that is written about sql authentication seems to assume a level of professional expertise which is appropriately associated with a multi-server environment. Which probably means that the developers may have XP on their desks, but that they're logging into an W2003 development environment...so they never get exposed to this problem (or are aware of it and bypass it).

If you miss the first branch in the decision tree, this is never mentioned...it's all about encrypting web.config and guarding against sql injection by limiting table access, clever ways to use trusted this and that....but never "maybe you should just use Windows Authentication, if it's a single server app."

Long way to the first u-turn....hazards of being a newbit!

|||

Similar grief here

http://www.mcse.ms/message2347651.html

Can't Get SQL Authentication to work in very simple test case

I'm trying to work my way through the steps of using a User Id and Password in a connection string.

I'm working with SQL 2005 Express, VS2005, in the development server. Got an error I can't get around...tried it several diffent ways on a slightly more complicated test site...no joy...so went to the MSDN tutorial...made the most "vanilla" test I could think of, and still can't figure it out.

I thought it would be simple enough that I could post the whole thing (below)

The test works fine with Integrated Security = True in the connection string. When I remove that phrase, I get the error:

{"CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file E:\MyPath\App_Data\VSST_DB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."}

This occurs on the cn.Open statement below.

It gets past the login, so I know that the SQL User and password match up correctly.

==========================
<connectionStrings>
<add name="VSST_CN"
connectionString="Data Source=MyServer\SQLEXPRESS;AttachDbFilename=E:\MyPath\App_Data\VSST_DB.mdf;User Id = VSST; Password=vsst123"
providerName="System.Data.SqlClient"/>
</connectionStrings>

=========================
Page Code Behind (no controls on page)

Imports System.Data
Imports System.Data.SqlClient

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim cn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("VSST_CN").ToString())

Dim cmd As SqlCommand = New SqlCommand("SELECT COUNT(*) FROM VSST_Table", cn)
cn.Open()
Dim rdr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
rdr.Read()
Response.Write(rdr(0).ToString())


End Sub
End Class


=================
The DB

Table VSST_Table,
ID is int, primary key, identity
Field1, Field2, Field3, Field4, Field5 are varchar(50)

I added one record ("A", "B", "C", "D", "E") to the table through VS2005 Server Explorer

This shows up in Count = 1 from running the page when Integrated Security = True

=================
In SSMSE: (this is ALL I did, tried to use the minimum so not to confuse...)

I added the SQL Authentication Server level user "VSST" with the password "vsst123" (and the login works, as noted above)

I attach the .mdf

I add VSST to the Database Users, and give it db_owner

I add VSST to the Table with all permissions checked.

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

I can't figure this out. This is a very vanilla test and I'm stumped. I'm about to give up on SQL Authentication entirely (at least for now), and just try to filter my inputs for SQL Injections...that's the only reason I have (at this stage in my biz plan) for needing SQL Authentication. On the other hand, I really don't like being this stumped on something that is so widely promoted as a common practice.

Any help on this would be greatly appreciated.

Thanks!

It's an XP SP2 security issue. The connect is running within an application sandbox which is not granted the authority to attach, create, or restore a database. The integrated security scenario works, because the Windows credentials are passed through. We spent days trying to figure a way around this one when dealing with a click once application installation and finally gave up. There wasn't a single permutation that we could use to get around the security restrictions that XP SP2 put in place. If the database already existed, everything connected and worked just fine. But, it simply refused to attach a database.|||

Thanks for the input. Wow. Good to know I wasn't completely blowing it....it looked too easy.

So, maybe it will work on the Windows 2003 VPS Server I'm renting...I guess I'll have to give it a try. But maybe it tells me I need to consider why SQL Authentication is critical to this app.

Grazie!

|||

I think there was something in the decision tree that I missed...

As I am gradually putting this together, it looks like the first choice is "1 server => windows authentication" vs "multiple servers (plus some other cases) => sql authentication"

After that, everything that is written about sql authentication seems to assume a level of professional expertise which is appropriately associated with a multi-server environment. Which probably means that the developers may have XP on their desks, but that they're logging into an W2003 development environment...so they never get exposed to this problem (or are aware of it and bypass it).

If you miss the first branch in the decision tree, this is never mentioned...it's all about encrypting web.config and guarding against sql injection by limiting table access, clever ways to use trusted this and that....but never "maybe you should just use Windows Authentication, if it's a single server app."

Long way to the first u-turn....hazards of being a newbit!

|||

Similar grief here

http://www.mcse.ms/message2347651.html