Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, March 21, 2012

hi, i need help on SQL, thanks


I'm doing a shopping cart using SQL Express and Visual Studio Web Developer on C#, ASP.NET

I recieved error when adding a order:

The variable name '@.oid' has already been declared. Variable names must be unique within a query batch or stored procedure.


The codes are:
comm = new SqlCommand("SELECT IDENT_CURRENT('Orders') as NewOrderID ");

comm.Connection = conn;
comm.Transaction = myTrans;

OrderID = Convert.ToInt32(comm.ExecuteScalar());

foreach (CartItem i in o.ItemList)
{
comm.CommandText = "INSERT INTO OrderDetail(OrderID, ProductID,Quantity, UnitPrice)VALUES (@.oid, @.pid, @.qty, @.price)";

comm.Parameters.AddWithValue("@.oid", OrderID);
comm.Parameters.AddWithValue("@.pid", i.ProductID);
comm.Parameters.AddWithValue("@.qty", i.Quantity);
comm.Parameters.AddWithValue("@.price", i.UnitPrice);
comm.Connection = conn;
comm.Transaction = myTrans;
comm.ExecuteNonQuery();
}

It seems that i can't add records into database with multiple loop.

Thanks in advance.

Well you want to only call once the insert for multiple items, that will optimize the code a little bit more.

Use TableAdapters, On the project right click and select Add New Item, select a DataSet and create a method to add multiple items!

|||

Try to clear parameters after each insert.

Add this to the end of your code block:

...........

comm.ExecuteNonQuery();

comm.Parameters.Clear();

}

|||

Thanksalbertpascual,

I'm not sure about using a TableAdapter, but does declaring the parameters outside the loop works?

I tried adding a dataset but with my limited 1month knowledge, I don't know how to complete the wizard or codes for the dataset.

if changing my existing codes works, it will be great.

thanks again,

|||

Hey, thanks alot Limno!!

but adding this sweet and simple "comm.Parameters.Clear();" it works..

thanks!!

Monday, March 19, 2012

Hi

May you let me know this is web base or not??Yes, this forum is web-based ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de

hey every.. a msde exporting question

hey i fairly new to this msde and webmatrix thing... and my question is.. how do i move my db in msde to a web host using a sql server

i have looked for tools on the net.. but none of them seem to be the one .. or maybe they using terms im not fimilar with..

pls help... much appreciated...bump!

Monday, March 12, 2012

Heterogeneous queries error

I'am attempting to modify an SMS 2003 web report to include data from a
linked SQL server. Running the query (report) in Query Analyzer works fine,
however, running the report via the web returns the error:
Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be
set for the connection. This ensures consistent query semantics. Enable these
options and then reissue your query.
Error Number: -2147217900
Source: Microsoft OLE DB Provider for SQL Server
Native Error: 7405
Any ideas how to would fix this?
Inside your proc, add SET ANSI_WARNINGS ON to the beginning of your code.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Chad" <Chad@.discussions.microsoft.com> wrote in message
news:D892A9F1-4184-479E-822F-A6F1939F85A8@.microsoft.com...
> I'am attempting to modify an SMS 2003 web report to include data from a
> linked SQL server. Running the query (report) in Query Analyzer works fine,
> however, running the report via the web returns the error:
> Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be
> set for the connection. This ensures consistent query semantics. Enable these
> options and then reissue your query.
> Error Number: -2147217900
> Source: Microsoft OLE DB Provider for SQL Server
> Native Error: 7405
> Any ideas how to would fix this?
|||I'm not using a stored procedure. SMS 2003 stores the SQL query in the
database as a text field, not as a stored procedure.
"Tibor Karaszi" wrote:

> Inside your proc, add SET ANSI_WARNINGS ON to the beginning of your code.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Chad" <Chad@.discussions.microsoft.com> wrote in message
> news:D892A9F1-4184-479E-822F-A6F1939F85A8@.microsoft.com...
>
>
|||OK, let me re-phrase:
Preceding any other statement in your code, execute that SET command...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Chad" <Chad@.discussions.microsoft.com> wrote in message
news:00AB7DD9-148F-4602-9E46-63C34CA3F576@.microsoft.com...[vbcol=seagreen]
> I'm not using a stored procedure. SMS 2003 stores the SQL query in the
> database as a text field, not as a stored procedure.
> "Tibor Karaszi" wrote:

Heterogeneous queries error

I'am attempting to modify an SMS 2003 web report to include data from a
linked SQL server. Running the query (report) in Query Analyzer works fine,
however, running the report via the web returns the error:
---
Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be
set for the connection. This ensures consistent query semantics. Enable these
options and then reissue your query.
Error Number: -2147217900
Source: Microsoft OLE DB Provider for SQL Server
Native Error: 7405
---
Any ideas how to would fix this?Inside your proc, add SET ANSI_WARNINGS ON to the beginning of your code.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Chad" <Chad@.discussions.microsoft.com> wrote in message
news:D892A9F1-4184-479E-822F-A6F1939F85A8@.microsoft.com...
> I'am attempting to modify an SMS 2003 web report to include data from a
> linked SQL server. Running the query (report) in Query Analyzer works fine,
> however, running the report via the web returns the error:
> ---
> Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be
> set for the connection. This ensures consistent query semantics. Enable these
> options and then reissue your query.
> Error Number: -2147217900
> Source: Microsoft OLE DB Provider for SQL Server
> Native Error: 7405
> ---
> Any ideas how to would fix this?|||I'm not using a stored procedure. SMS 2003 stores the SQL query in the
database as a text field, not as a stored procedure.
"Tibor Karaszi" wrote:
> Inside your proc, add SET ANSI_WARNINGS ON to the beginning of your code.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Chad" <Chad@.discussions.microsoft.com> wrote in message
> news:D892A9F1-4184-479E-822F-A6F1939F85A8@.microsoft.com...
> > I'am attempting to modify an SMS 2003 web report to include data from a
> > linked SQL server. Running the query (report) in Query Analyzer works fine,
> > however, running the report via the web returns the error:
> >
> > ---
> > Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be
> > set for the connection. This ensures consistent query semantics. Enable these
> > options and then reissue your query.
> >
> > Error Number: -2147217900
> > Source: Microsoft OLE DB Provider for SQL Server
> > Native Error: 7405
> > ---
> >
> > Any ideas how to would fix this?
>
>|||OK, let me re-phrase:
Preceding any other statement in your code, execute that SET command...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Chad" <Chad@.discussions.microsoft.com> wrote in message
news:00AB7DD9-148F-4602-9E46-63C34CA3F576@.microsoft.com...
> I'm not using a stored procedure. SMS 2003 stores the SQL query in the
> database as a text field, not as a stored procedure.
> "Tibor Karaszi" wrote:
> > Inside your proc, add SET ANSI_WARNINGS ON to the beginning of your code.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "Chad" <Chad@.discussions.microsoft.com> wrote in message
> > news:D892A9F1-4184-479E-822F-A6F1939F85A8@.microsoft.com...
> > > I'am attempting to modify an SMS 2003 web report to include data from a
> > > linked SQL server. Running the query (report) in Query Analyzer works fine,
> > > however, running the report via the web returns the error:
> > >
> > > ---
> > > Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be
> > > set for the connection. This ensures consistent query semantics. Enable these
> > > options and then reissue your query.
> > >
> > > Error Number: -2147217900
> > > Source: Microsoft OLE DB Provider for SQL Server
> > > Native Error: 7405
> > > ---
> > >
> > > Any ideas how to would fix this?
> >
> >
> >

Friday, March 9, 2012

help-login failed for MACHINE_NAME\IUSR_MACHINE_NAME

HI,
i have some problem,

one database 'SMS' is installed in sql server which instance is
BARODA\EMIS.

now i want to connect my web app to this database.
for that
my connectionstring is
--
conn.ConnectionString = "workstation id=BARODA;packet size=4096;integrated security=SSPI;data source=BARODA\EMIS;persist security info=True;initial catalog=SMS"
--

but when i run this error occur

--
login failed for 'MERIDIAN\IUSR_BARODA'
--

for that what should i do?
give any solution.

it's urgent.

thanks in advance.Hi,

This blog might help you:http://weblogs.asp.net/coltk/archive/2003/07/10/9920.aspx

Colt|||hey, colt

my problem,

i want to creat user in MSDE.

how to create user in MSDE?
how to create user in MSDE during app. installation?

give any solution.
it's urgent.

thanks in advance.

Wednesday, March 7, 2012

help?

I need a little help to get me going.

I have built a web app in visual web developer and made and

inserted an sql db into the site with multiple .aspx pages.

It all compiles and seems great. Info from the db is displayed,however

when it comes to edit, insert or delete it bombs out

" incorrect syntax near'nvarchar' or on delete........'int'

some thing needs to be set to true...

All conection strings seem fine and test ok.

ps, whats the best way to to totally smash your dell laptop to pieces

and send it to pluto?

Have included error

Do you compose the commands on your own ? If yes, try to see what command(text) is actually executed against the database. if not, startup profiler to see the command executed.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

I don,t write the commands yet myself....all key events.

I will check and reply

Many thanks

|||Sure, come back if you have any questions.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Still got this glitch.

Could you have a look at the code for me.....the source code seems all to be ok with the target?

|||Seems that the statements posted do not contain any information about nvarchar, so I guess this is related to any trigger based on the tables. Have alook if there are any triggers which might get fired during the DML process.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Hi jens

thanks for your help recently.

I found out that i was trying to load data to my sql with the details view "tool" ................oops.

My test sql seems to be working like a train now. Also now discovering the full functionality

of sql and can see that im at the bottom of a large hill.

My next problem is publishing.

My hosting package has been upgraded to the version 2.0 asp.net runtime. and has sql enabled.

web dev.......copy function drops all the files into the server nicely and i can see them all.

The problem is it will not unwrap or show, and returns.........you do not have privaleges to view this htm.

All a bit strange to me but?

I have not touched any of the security controls in the config manager or code.

regards Richard uk

Help; ASP web site, IIS 6.0, Server 2003, SQL server 2000

Hi
I,m new to Server 2003 and I'm moving an ASP website to it.
This is what I have; an basic ASP web site that connects to a "SQL server
2000" database on Windows XP box, using IIS.
Now I have moved the site to Server 2003, on IIS 6, but I'm still using "SQL
Server 2000"
However I can't get the website to connect to the database. this is the
error I'm am geting
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied.
/uoc/include/Common.asp, line 100
In IIS 6.0, under the Directory Security tab, I'm using anonymous access,
and it uses the user IUSR_<computername>. Also I have Integrated Windows
authentication checked off. Is there some security setting that I need to
set, or do I need to give more access to the "IUSR" user? (oh and I also
confirmed that SQL server is using SQL Server and Windows Authentication )
Thanks for any help you can give me.
http://spaces.msn.com/members/anthonyarms/
is there an OLEDB connection string in that Common.asp page? it sounds
like thats your connection string. you may need to modify it
accordingly.
|||Thanks for the reply
My connection looks like this :
Application("Connection_ConnectionString") = "Provider=SQLOLEDB.1;Persist
Security Info=False;User ID=[database_name];Initial Catalog=UOC;Data
Source=[computer_name];Use Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=[computer_name];Use Encryption for Data=False;Tag
with column collation when possible=False;User
Id=[user_name];PASSWORD=[password];"
I don't know if I need to change anything on Server 2003 (the only things I
changed is the text in the square brackets )
Do you think it could be something else?
thanks for any incite you can provide
http://spaces.msn.com/members/anthonyarms/
"GlennThomas5" wrote:

> is there an OLEDB connection string in that Common.asp page? it sounds
> like thats your connection string. you may need to modify it
> accordingly.
>

Help; ASP web site, IIS 6.0, Server 2003, SQL server 2000

Hi
I,m new to Server 2003 and I'm moving an ASP website to it.
This is what I have; an basic ASP web site that connects to a "SQL server
2000" database on Windows XP box, using IIS.
Now I have moved the site to Server 2003, on IIS 6, but I'm still using "SQL
Server 2000"
However I can't get the website to connect to the database. this is the
error I'm am geting
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access
denied.
/uoc/include/Common.asp, line 100
In IIS 6.0, under the Directory Security tab, I'm using anonymous access,
and it uses the user IUSR_<computername>. Also I have Integrated Windows
authentication checked off. Is there some security setting that I need to
set, or do I need to give more access to the "IUSR" user? (oh and I also
confirmed that SQL server is using SQL Server and Windows Authentication )
Thanks for any help you can give me.
--
http://spaces.msn.com/members/anthonyarms/Try adding a SQL Server UID and PWD to the connection string.
"ARMS" <anthonyarms@.gmail.com> wrote in message
news:289D8794-31E0-4F67-BC55-F07E18A0875C@.microsoft.com...
> Hi
> I,m new to Server 2003 and I'm moving an ASP website to it.
> This is what I have; an basic ASP web site that connects to a "SQL server
> 2000" database on Windows XP box, using IIS.
> Now I have moved the site to Server 2003, on IIS 6, but I'm still using
"SQL
> Server 2000"
> However I can't get the website to connect to the database. this is the
> error I'm am geting
> Microsoft OLE DB Provider for SQL Server error '80004005'
> [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist o
r access
> denied.
> /uoc/include/Common.asp, line 100
> In IIS 6.0, under the Directory Security tab, I'm using anonymous access,
> and it uses the user IUSR_<computername>. Also I have Integrated Windows
> authentication checked off. Is there some security setting that I need to
> set, or do I need to give more access to the "IUSR" user? (oh and I also
> confirmed that SQL server is using SQL Server and Windows Authentication )
> Thanks for any help you can give me.
> --
> http://spaces.msn.com/members/anthonyarms/

Help; ASP web site, IIS 6.0, Server 2003, SQL server 2000

Hi
I,m new to Server 2003 and I'm moving an ASP website to it.
This is what I have; an basic ASP web site that connects to a "SQL server
2000" database on Windows XP box, using IIS.
Now I have moved the site to Server 2003, on IIS 6, but I'm still using "SQL
Server 2000"
However I can't get the website to connect to the database. this is the
error I'm am geting
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied.
/uoc/include/Common.asp, line 100
In IIS 6.0, under the Directory Security tab, I'm using anonymous access,
and it uses the user IUSR_<computername>. Also I have Integrated Windows
authentication checked off. Is there some security setting that I need to
set, or do I need to give more access to the "IUSR" user? (oh and I also
confirmed that SQL server is using SQL Server and Windows Authentication )
Thanks for any help you can give me.
http://spaces.msn.com/members/anthonyarms/
Try adding a SQL Server UID and PWD to the connection string.
"ARMS" <anthonyarms@.gmail.com> wrote in message
news:289D8794-31E0-4F67-BC55-F07E18A0875C@.microsoft.com...
> Hi
> I,m new to Server 2003 and I'm moving an ASP website to it.
> This is what I have; an basic ASP web site that connects to a "SQL server
> 2000" database on Windows XP box, using IIS.
> Now I have moved the site to Server 2003, on IIS 6, but I'm still using
"SQL
> Server 2000"
> However I can't get the website to connect to the database. this is the
> error I'm am geting
> Microsoft OLE DB Provider for SQL Server error '80004005'
> [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
> denied.
> /uoc/include/Common.asp, line 100
> In IIS 6.0, under the Directory Security tab, I'm using anonymous access,
> and it uses the user IUSR_<computername>. Also I have Integrated Windows
> authentication checked off. Is there some security setting that I need to
> set, or do I need to give more access to the "IUSR" user? (oh and I also
> confirmed that SQL server is using SQL Server and Windows Authentication )
> Thanks for any help you can give me.
> --
> http://spaces.msn.com/members/anthonyarms/

Help; ASP web site, IIS 6.0, Server 2003, SQL server 2000

Hi
I,m new to Server 2003 and I'm moving an ASP website to it.
This is what I have; an basic ASP web site that connects to a "SQL server
2000" database on Windows XP box, using IIS.
Now I have moved the site to Server 2003, on IIS 6, but I'm still using "SQL
Server 2000"
However I can't get the website to connect to the database. this is the
error I'm am geting
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access
denied.
/uoc/include/Common.asp, line 100
In IIS 6.0, under the Directory Security tab, I'm using anonymous access,
and it uses the user IUSR_<computername>. Also I have Integrated Windows
authentication checked off. Is there some security setting that I need to
set, or do I need to give more access to the "IUSR" user? (oh and I also
confirmed that SQL server is using SQL Server and Windows Authentication )
Thanks for any help you can give me.
--
http://spaces.msn.com/members/anthonyarms/is there an OLEDB connection string in that Common.asp page? it sounds
like thats your connection string. you may need to modify it
accordingly.|||Thanks for the reply
My connection looks like this :
Application("Connection_ConnectionString") = "Provider=SQLOLEDB.1;Persist
Security Info=False;User ID=[database_name];Initial Catalog=UOC;Data
Source=[computer_name];Use Procedure for Prepare=1;Auto Translate=True;P
acket
Size=4096;Workstation ID=[computer_name];Use Encryption for Data=False;T
ag
with column collation when possible=False;User
Id=[user_name];PASSWORD=[password];"
I don't know if I need to change anything on Server 2003 (the only things I
changed is the text in the square brackets )
Do you think it could be something else?
thanks for any incite you can provide
--
http://spaces.msn.com/members/anthonyarms/
"GlennThomas5" wrote:

> is there an OLEDB connection string in that Common.asp page? it sounds
> like thats your connection string. you may need to modify it
> accordingly.
>

Help; ASP web site, IIS 6.0, Server 2003, SQL server 2000

Hi
I,m new to Server 2003 and I'm moving an ASP website to it.
This is what I have; an basic ASP web site that connects to a "SQL server
2000" database on Windows XP box, using IIS.
Now I have moved the site to Server 2003, on IIS 6, but I'm still using "SQL
Server 2000"
However I can't get the website to connect to the database. this is the
error I'm am geting
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied.
/uoc/include/Common.asp, line 100
In IIS 6.0, under the Directory Security tab, I'm using anonymous access,
and it uses the user IUSR_<computername>. Also I have Integrated Windows
authentication checked off. Is there some security setting that I need to
set, or do I need to give more access to the "IUSR" user? (oh and I also
confirmed that SQL server is using SQL Server and Windows Authentication )
Thanks for any help you can give me.
--
http://spaces.msn.com/members/anthonyarms/is there an OLEDB connection string in that Common.asp page? it sounds
like thats your connection string. you may need to modify it
accordingly.|||Thanks for the reply
My connection looks like this :
Application("Connection_ConnectionString") = "Provider=SQLOLEDB.1;Persist
Security Info=False;User ID=[database_name];Initial Catalog=UOC;Data
Source=[computer_name];Use Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=[computer_name];Use Encryption for Data=False;Tag
with column collation when possible=False;User
Id=[user_name];PASSWORD=[password];"
I don't know if I need to change anything on Server 2003 (the only things I
changed is the text in the square brackets )
Do you think it could be something else?
thanks for any incite you can provide
--
http://spaces.msn.com/members/anthonyarms/
"GlennThomas5" wrote:
> is there an OLEDB connection string in that Common.asp page? it sounds
> like thats your connection string. you may need to modify it
> accordingly.
>

Help:DTC-Firewall-SQL server clustering

Hello All
I am having trouble of DTC to get working thru firewall
The setup we have is
Two web servers load balanced. Componets run off the web servers. (OS:2000 Server
Two SQL server clusered.(OS: 2000 advanced server)
Web servers and SQL Servers are in different domain separated by firewall
Components do not work if I set "transaction required". If I changed it to "Transaction suported" or "not supported" some componets do work
I tried suggestions from kb article
DTCPing: http://support.microsoft.com/?id=30684
Initially DTCping had some problem but for testing purpose we opened all ports on firewall. It worked
I tried another config suggestion
http://support.microsoft.com/?id=25036
When I apply the registry entries for ports mentioned in this article, it disabled Clustering service. I was not able to get it back until I revert back registry settings
I tried DTCtester utility, it doesn't work
Does any one know why it must be disabling the clustering service? or Have any other suggestions on configuration for DTC thru Firewall
Thank
MilsThanks Jeff
I tried the procedure you mentioned. but it did not help
I have already tried the DTCping utility. At first it did not work but then I opened all the ports on firewall. now DTCping works.
DTCtester.exe utility still does not run, it gives error
Output of utility
****************
E:\netins>dtctester vssql01 uname Pw
Executed: dtcteste
DSN: vssql0
User Name: unam
Password: pw
tablename= #dtc1236
Creating Temp Table for Testing: #dtc1236
Warning: No Columns in Result Set From Executing: 'create table #dtc12365 (iva
int)
Initializing DT
Beginning DTC Transactio
Enlisting Connection in Transactio
Error
SQLSTATE=25S12,Native error=-2147168242,msg='[Microsoft][ODBC SQL Server Driver
Distributed transaction error
Error
SQLSTATE=24000,Native error=0,msg=[Microsoft][ODBC SQL Server Driver]Invalid cu
sor stat
Typical Errors in DTC Output Whe
a. Firewall Has Ports Close
-OR
b. Bad WINS/DNS entrie
-OR
c. Misconfigured networ
-OR
d. Misconfigured SQL Server machine that has multiple netcards
Aborting DTC Transactio
Releasing DTC Interface Pointer
Successfully Released pTransaction Pointer.
*********************************
One of the error description refers to multiple netcards. Our SQL server has multiple netcards.
Any idea if there's any specific configuration for SQL Server using multiple netcards
Thanks
Milin|||1. Are the ports still open. If not then you need to open ports 445, 135,137-9, plus the ones you set in DCOMCNFG
2. Do you have an entry in each server of the cluster's host file with an entry to the destination server. and likewise on the destination for each of the Clustered servers
3. Does DTCPing work both ways now also
Jef
MCDBA, MCSE+I|||Yes. All ports are still open in both directions
I have entries in hosts files of both servers. I can access these servers using network names from each other
DTCping work in both directions
Thank
mil|||Did you actually set the ports with DCOMCNFG and reboot or did you just try the reg hack
If not then set DCOMCNFG on all servers to use the proper ports and reboot all servers
Other than that I cannot think of anything else
Good Luc
Jeff|||Mil
I am sorry then. In all my experience once I have had DTCping working I have had DTC working as well
Jeff|||"mils" wrote:
> When I apply the registry entries for ports mentioned in this article, it disabled Clustering service. I was not able to get it back until I revert back registry settings.
Hi,
I have the same problem.
when i set the port by dcomcfg (or by registry), the nodes cannot start clustering services.
WhY '
How can i do ?
thanks in advance !!
Regards, Dario

HELP: SSEE problems

I've a Windows 2003 Server Web Edition server. I've installed SSEE on
the same server. I've 5 domains (and 5 different web applications).
Every app needs to connect to 1 different db.
Both, with native securiy or Windows security, I obtain that only 1 app
work correctly while with the others I obtain "Application Server
Unavailable". If I connect all the apps to the same db then all works right.
Can someone hel me to solve this problem?
Thanks in advance,
FrancoHi Fransis
"Fransis il Mulo" wrote:

> I've a Windows 2003 Server Web Edition server. I've installed SSEE on
> the same server. I've 5 domains (and 5 different web applications).
> Every app needs to connect to 1 different db.
> Both, with native securiy or Windows security, I obtain that only 1 app
> work correctly while with the others I obtain "Application Server
> Unavailable". If I connect all the apps to the same db then all works righ
t.
> Can someone hel me to solve this problem?
> Thanks in advance,
> Franco
Have you enabled network protocols for SQL Express? By default they will be
disabled, but that can be overridden when you install SQL Express or later
using SQL Server Configuration Manager see
http://msdn2.microsoft.com/en-us/library/ms165718.aspx
John

Monday, February 27, 2012

Help: SQL 2000 connection error(.NET 2.0, VS 2005)

Moderated by XIII, please use a normal font size for better readability:

for some reason, my web application can not connect to my SQL 2000

my application is based on .net 2.0 (IIS 5.1) using vs 2005workstation does not install any sql serversql 2000 locates at the remote server.the sql server can be connected via vs environment (data connnection), therefore, i think the connection string, server name and instance name is correcti have tried all the solution i can find online, but it is not workingLocalSQLServer connection string has been removed in GobalSettingalso remove all default connection string in web.config (<clear />)aspnet_regsql can register the sql 2000 db successfulvs 2005 can access and display the data in sql 2000 quite wellhas been reboot lots of times.still bug out

any body have any idea? thanks, it already costs me the whole day

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)

Can you telnet to the remote server (test TCP/IP)? And how about "net use\\servername\IPC$" the remote server (test Named pipe)? You can take a look at this post:

http://forums.asp.net/thread/1266057.aspx

|||

Thank Jay,

I can telnet to the remote server. Actually, I think the connection to the remote server is correct (in VS 2005 environment the data can be display quite well), the only problem is .NET 2.0 always think the remote server is SQL 2005. I have removed the localSQLServer connection string in web.config file (<clear />) but still not working.

|||

Then how about force to use TCP/IP to connect? You can do this by usingtcp:myinstance,portas Data Source, where port is the tcp port used the SQL instance service. Actually there should be no difference when connect to SQL2005 or SQL2000, you can take a look at this article which shows how to place membership on SQL2000:

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

Sunday, February 19, 2012

HELP: ASP.NET won''t connect to SQLexpress after deploying to IIS, try a lot of things...

Hello,

I have finish building my ASP.NET site using VS 2005 and it compile just fine. Than I try hosting it to the web via IIS v5.1 and I am getting permission error from SQL express.

I have posted a detail question in experts-exchange.com and since you need a user account to even view the thread, I have taken the liberty to save the thread as .html file and host it to my ISP site. You can see the detail problem I am having here: http://users.accesscomm.ca/mm/EEdetail.html

I am going to list out some stuff I have done:

1. I have two database that need access, the ASPNETDB.mdf for user login and another database (PhotoDataBase.mdf) to store information relating to the photo I uploaded to my ASP.NET site.

2. I have already follow this How to site: http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx and setup:
- TCP/IP enable, as shown here:
- I have started SQL Browser service
- The firewall part I am not so sure about. I am currently using Zonealarm....

3. I have installed SQL Server Management Studio Express(SSMSE) and attach the two database to it.

4. I have set SSMSE server properties to accept both SQL and window authentication.

5. I have made sure that both database "read only" setting to false

6. I have setup SQL login with User ID = SQLLOGIN

Here is the original connection in web.config:
<add name="ConnectionString"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|Da

taDirectory|\PhotoDataBase.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />

and here is the new connection I just type in web.config that replace the original one:
<add name="ConnectionString"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PhotoDataBase.mdf; Server=MINGDESKTOP; Integrated Security=False; uid=SQLLOGIN; Password=XXXXXX;"
providerName="System.Data.SqlClient" />

and the error i get are the follow:

Server Error in '/' Application.
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)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

7. I did haven't done much to ASPNETDB.mdf yet and the error i get right now are the following:

_

___
Server Error in '/' Application.
Cannot open user default database. Login failed.
Login failed for user 'MINGDESKTOP\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'MINGDESKTOP\ASPNET'.
__

Please help! I am really running out of ideas.... and I need to have this setup in a few days....

Thanks!

These two links will take you in the right direction but you still have the ASPNETDB as a User Instance database which is not supported in other editions of SQL Server so you need to correct that also. In Asp.net deployment takes careful planning or any part of the application can stop the deployment. Hope this helps.

http://geekswithblogs.net/ranganh/archive/2005/04/25/37613.aspx

http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx

|||

Caddre wrote:

These two links will take you in the right direction but you still have the ASPNETDB as a User Instance database which is not supported in other editions of SQL Server so you need to correct that also. In Asp.net deployment takes careful planning or any part of the application can stop the deployment. Hope this helps.

http://geekswithblogs.net/ranganh/archive/2005/04/25/37613.aspx

http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx

Thanks! This is the answer I needed!

|||

I am glad I could help.

Help...pls check whats wrong....not able to do insert with sqldatasource

Hi frdz,

I m the new user of ASP.NET WEB APPLICATIONS WITH C# LANGUAGE.
I m using SQL SERVER 2005 and SQLDATASOURCE to get or retrieve the data from the database.
I have created the stored procedure for insert and update.
The stored procedure is executing fine when i m running it from sqlserver2005.

My problem is with the web-application page.
I m not able to insert or update data thru that...
Pls check the code and tell me what's missing out ........

SQLDATASOURCE

<asp:SqlDataSource ID="srcemp" runat="server" ConnectionString="<%$ ConnectionStrings:empmaster %>"
InsertCommand="empStoredProcedure" InsertCommandType="StoredProcedure"
UpdateCommand="empStoredProcedure" UpdateCommandType="StoredProcedure"
DeleteCommand="DELETE FROM empmaster
WHERE empid = @.empid" DeleteCommandType="Text"
SelectCommand="select * from empmaster " SelectCommandType="Text">
<InsertParameters>
<asp:Parameter Name="empname" Type="String" />
<asp:Parameter Name="address" Type="String" />
<asp:Parameter Name="city" />
<asp:Parameter Name="pincode" />
<asp:Parameter Name="state" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="empname" Type="String" />
<asp:Parameter Name="address" Type="String" />
<asp:Parameter Name="city" />
<asp:Parameter Name="pincode" />
<asp:Parameter Name="state" />
</UpdateParameters>
</asp:SqlDataSource
GRIDVIEW

<asp:GridView ID="empGridView" runat="server" AutoGenerateColumns="False"
DataKeyNames="empid" DataSourceID="srcemp"
Width="56px" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="btnDelete" runat="server" CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete this row ?');">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>


<asp:boundfield datafield="empname"
headertext="emp Name"/>
<asp:boundfield datafield="address"
headertext="Address"/>
<asp:boundfield datafield="city"
headertext="City"/>
<asp:boundfield datafield="state"
headertext="State"/>


<asp:CheckBoxField
DataField="deleted"
HeaderText="In Existance" />

</Columns>

</asp:GridView
C# code

protected void cmdsubmit_Click(object sender, EventArgs e)
{
srcemp.InsertParameters["empname"].DefaultValue = tbcompanyname.Text;
srcemp.InsertParameters["address"].DefaultValue = tbaddress.Text;
srcemp.InsertParameters["city"].DefaultValue = tbcity.Text;
srcemp.InsertParameters["pincode"].DefaultValue = tbpincode.Text;
srcemp.InsertParameters["state"].DefaultValue = cmbstate.SelectedItem.ToString();

srcemp.Insert();
}

Note :

I m not getting a single error msg for the above code in web-page or stored procedure but it does not insert,update or delete the record from the database...
Thanxs in adv...

pls reply at earliest if possible...What's missing ??

can anyone check out..what's wrong ??

Hi,

From your code, it seems that your parameters come from TextBox and DropDownList. So you should try this way:

<asp:SqlDataSource ID="srcemp" runat="server" ConnectionString="<%$ ConnectionStrings:empmaster %>"
InsertCommand="empStoredProcedure" InsertCommandType="StoredProcedure"
UpdateCommand="empStoredProcedure" UpdateCommandType="StoredProcedure"
DeleteCommand="DELETE FROM empmaster
WHERE empid = @.empid" DeleteCommandType="Text"
SelectCommand="select * from empmaster " SelectCommandType="Text">
<InsertParameters>

<asp:ControlParameter Name="empname" ControlId="tbcompanyname" PropertyName="Text"/>
<asp:ControlParameter Name="address" ControlId="tbaddress" PropertyName="Text"/>
<asp:ControlParameter Name="city" ControlId="tbcity" PropertyName="Text"/>
<asp:ControlParameter Name="pincode" ControlId="tbpincode" PropertyName="Text"/>
<asp:ControlParameter Name="state" ControlId="cmbstate" PropertyName="SelectedItem"/>

</InsertParameters>
<UpdateParameters>
<asp:ControlParameter Name="empname" ControlId="tbcompanyname" PropertyName="Text"/>
<asp:ControlParameter Name="address" ControlId="tbaddress" PropertyName="Text"/>
<asp:ControlParameter Name="city" ControlId="tbcity" PropertyName="Text"/>
<asp:ControlParameter Name="pincode" ControlId="tbpincode" PropertyName="Text"/>
<asp:ControlParameter Name="state" ControlId="cmbstate" PropertyName="SelectedItem"/>

</UpdateParameters>
</asp:SqlDataSource>

In your C# code:

protected void cmdsubmit_Click(object sender, EventArgs e)
{
srcemp.Insert();
}

Hope this helps. Thanks.