Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Monday, March 26, 2012

Establish SQL Connection

Hi! (my first post)

I'm ASP.NET newbie and i´ve got anSQL connection error, i know why, ididn´t establish a connection...
my questions are: how do i establish the connection state?, and where in my project should i do it?

I added the connection section to my web.config, is that enough to establish a connection?

<connectionStrings>
<add name="buscomConnectionString" connectionString="Data Source=myserver.net;Initial Catalog=mycatalog;Persist Security Info=True;User ID=myuser;Password=mypassword"
providerName="System.Data.SqlClient" />
</connectionStrings>

The error i get is:

Object reference not set to an instance of an object.

Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

Exception Details:System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 2443:
Line 2444://If connection is not open then attempt to open it.
Line 2445:if (connection.State == System.Data.ConnectionState.Closed)
Line 2446:{
Line 2447:try


Source File: d:\User\buscom\App_Code\PHP.cs Line: 2445

Thanks and cheers!

Bill Murphy (litio.net)

Welcome to ASP.NET ForumsSmile The section you added in web.config is just to store a conneciton string which then can be used in your application. You can create a connection using the connection string like:

SqlConnection conn= new SqlConnection(ConfigurationManager.ConnectionStrings["Access"].ConnectionString.ToString());

Then use Open method to open it:

Conn.Open();

Or you can create a SqlCommand with the connection:

SqlCommand cmd= new SqlCommand("SELECT * FROM sysobjects",conn);

Or do other things as you like. To learn various database connections in ASP .NET, you can start from here:

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

However I suggest you use 'using' block to embed database operations so that the connection will be automatically disposed, so to avoid leaving unuseful open connections. That is:

using (SqlConnection conn= new SqlConnection(ConfigurationManager.ConnectionStrings["Access"].ConnectionString.ToString()))

{//add your code

}

To learn more about connection Close/Dispose in .NET, you can take a look at this article:

http://codebetter.com/blogs/sahil.malik/archive/2004/12/31/40036.aspx

|||

That was what I was looking for!! just didn´t seem to find it :D
Both link where very helpfull.

Thanks a lot!

|||

sorry, buy looking into that didn´t work out. i have to reopen my question...

I am using the PHPMigration assistant, so i went ahead and generated the connect command and got the following:

try {PHP.MSSQLSupport.Connect(host, user, password); }

catch(System.Exception) {Response.Write("Error, no server"); }

try {PHP.MSSQLSupport.ChangeDatabas
________________________________________________________

This is a duplicate of your other post:http://forums.asp.net/thread/1387576.aspx

Duplicate posts are not permitted on theASP.NET Forums. As a result, the duplicate post has been deleted. We trust however that you will receive helpful replies to your other post, linked above.

Please be aware that theASP.NET Forums are moderated. This means that there will always be a delay between submitting a message and seeing it appear on the forums. There is no need to submit a message multiple times.

Thanks,
ASP.NET Forums team

",0]);//-->e(bbdd);}

catch (System.Exception) { Response.Write( bbdd + " not found"); }

Inserted it into my page and the error above persists.

i am passing a null to PHP.MSSQLSupport.Query, that should reopen the last connection, so i guessI'm just not opening the connection as i should...

How should iestablish the connection with the PHPMigration assistant generatedcode? should i remove the info on the web. config or the above lines?

should i mention my connection string name ( buscomConnectionString )anywhere in the code? or should the above code be enough?

if the databese isn´t connecting properly, would i get a different error? (maybe Error, no server as i specified??)

|||This is what i meant to post:

sorry, buy looking into that didn´t work out. i have to reopen my question...

I am using the PHPMigration assistant, so i went ahead and generated the connect command and got the following:

try {PHP.MSSQLSupport.Connect(host, user, password); }

catch(System.Exception) {Response.Write("Error, no server"); }

try {PHP.MSSQLSupport.ChangeDatabase(bbdd);}

catch (System.Exception) { Response.Write( bbdd + " not found"); }

Inserted it into my page and the error above persists.

i am passing a null to PHP.MSSQLSupport.Query, that should reopen the last connection, so i guessI'm just not opening the connection as i should...

How should iestablish the connection with the PHPMigration assistant generatedcode? should i remove the info on the web. config or the above lines?

should i mention my connection string name ( buscomConnectionString )anywhere in the code? or should the above code be enough?

if the databese isn´t connecting properly, would i get a different error? (maybe Error, no server as i specified??)

Essentioal Relationship Question(s) [URGENT]!

Hi all;

[In case of creating a PK -FK relation]
When creating a DB cia VS.NET and from "Propert Pages -> on [Relationships] tap" there are many checkboxes (shown bellow), What question(s) should I ask my self in order to check the correct and right checkbox.

[1] Check existing data on creation.

[2] Enforce relationship for replication.

[3] Enforce relationship for INSERTs and UPDATEs.

[4] Cascade Update Related Fields.

[5] Cascade Delete Related Records.

(6) Cascade Update Related Fields.

(7) Cascade Delete Related Records.

Please, help me to under stand what should (to check betwwen thoses checkboxes)..

Thanks in advanced!

NOTE:
---
This is a URGENT messagem beacuse based on your answers or explaination I will build my Project DB. so, plz be coperative as you always..

++++++
~CS4Ever~
++++++Sorry, but have you considered reading the documentation?

You basically ask us to explain you what checkboxes on a SQL Server create relation dialog mean - this is all really well documented in - the documentation.|||I am not asking what those checkboxes do? I am asking who to be confident while checking thoses checkboxes (in otherwords, what should I ask myself to be confident?)?

Sorry for this question, but I am still beginner.

Hope my question is clear!|||Up plz.

I read about them "In a Complete Reference SQL (OSBORBE Book)>
(*) Inserting a new child row.
(*) Updating the forign key in a child row.
(*) Deleting a parent row. I
(*) Updatng the primary key in the parent row.

and I understod them (hopfully), BUT still I am asking about What question that I should ask myself in order to be confident when makeing the decision??

Hope you can help me gays!!

Thanks in advanced.|||plz, help me.

Just remember youself when you were beginner!!

Plz, help me.

Thanks.

Thursday, March 22, 2012

Errot :can not connect to server

i am getting error to connect C#.net with sql server. how to solve the problem?

frstly check u hv written proper code and given proper path to ur database..

i hv a copy of it. see this.. this may help

using System.Data.SqlClient;

SqlConnection myConnection = new SqlConnection("user id=username;" +
"password=password;server=serverurl;" +
"Trusted_Connection=yes;" +
"database=database; " +
"connection timeout=30");

try
{
myConnection.Open();
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}

myCommand.Connection = myConnection;

myCommand.CommandText = "ur query"

myCommand.ExecuteNonQuery();

try
{
SqlDataReader myReader = null;
SqlCommand myCommand = new SqlCommand("select * from table",
myConnection);
myReader = myCommand.ExecuteReader();
while(myReader.Read())
{
Console.WriteLine(myReader["Column1"].ToString());
Console.WriteLine(myReader["Column2"].ToString());
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}

Wednesday, March 21, 2012

Errors with Service Pack 1

Hi Ng,
i have some problems with Rs Sp 1. I installed Sp 1 on the server and on the
pc where vs.net is installed. Now I got the following Problem:
I design a report and go to the preview mode. If an error is found, for
example a syntax problem in an expression, the report isn't displayed. No
problem till here. But now I change the expression, so that it's correct,
the report can't be displayed anyway. And from now on, the report won't show
in preview mode ever, even when the report is complete empty!!!
I deletet the report, copied the rdl code in a new one, and it could be
displayed. Renaming this report to the other name, can't be displayed...
Any Ideas?
Thanks in Advance
G. SchmelzerCould you please send me the exact steps to reproduce? I tried the following
but couldn't reproduce the issue:
1. Go to Layout view in Report Designer
2. Drop a textbox
3. Type the expression =Globals!ReportName in it
4. Preview (works fine)
5. Go back to layout.
6. Change the expression to =zzz_Globals!ReportName
7. Preview (returns an error)
8. Go back to layout.
9. Change the expression back to =Globals!ReportName
10. Preview (works fine)
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"G. Schmelzer" <asdf@.de.de> wrote in message
news:OwPYh2nXEHA.2816@.TK2MSFTNGP11.phx.gbl...
> Hi Ng,
> i have some problems with Rs Sp 1. I installed Sp 1 on the server and on
the
> pc where vs.net is installed. Now I got the following Problem:
> I design a report and go to the preview mode. If an error is found, for
> example a syntax problem in an expression, the report isn't displayed. No
> problem till here. But now I change the expression, so that it's correct,
> the report can't be displayed anyway. And from now on, the report won't
show
> in preview mode ever, even when the report is complete empty!!!
> I deletet the report, copied the rdl code in a new one, and it could be
> displayed. Renaming this report to the other name, can't be displayed...
>
> Any Ideas?
> Thanks in Advance
> G. Schmelzer
>

Errors when trying to open the report designer

I am trying to open a report solution using the report designer (Visual
Studio .NET 2003) and I am getting several errors, here is the first one:
"Package 'ReportDesignerPackage' has failed to load properly ( GUID = {11B8903-8FFD-4Dfc-87CEF6A82D77AF68} ). Please contact package vendor for
assistance. Would you like to disable loading this package in the future?
You may use 'devenv/resetskippkgs' to re-enable package loading. Application
restart is recommended, due to possible environment corruption."
This error is followed by several more "Package failed to load properly"
ones before the report designer finally opens (but it will not load my
reporting services project folders and files).
Other people can open this solution without a problem. Is there some
security setting that is causing me to get these errors' Help please.
--
LaurieTHave a look to these articles
http://support.microsoft.com/?id=823245
http://support.microsoft.com/?id=830968
--
Bien cordialement
Med Bouchenafa
"LaurieT" <LaurieT@.discussions.microsoft.com> a écrit dans le message de
news: 05A1B2AE-4F32-4A80-AE7A-C57E4ED5E4D7@.microsoft.com...
>I am trying to open a report solution using the report designer (Visual
> Studio .NET 2003) and I am getting several errors, here is the first one:
> "Package 'ReportDesignerPackage' has failed to load properly ( GUID => {11B8903-8FFD-4Dfc-87CEF6A82D77AF68} ). Please contact package vendor for
> assistance. Would you like to disable loading this package in the future?
> You may use 'devenv/resetskippkgs' to re-enable package loading.
> Application
> restart is recommended, due to possible environment corruption."
> This error is followed by several more "Package failed to load properly"
> ones before the report designer finally opens (but it will not load my
> reporting services project folders and files).
> Other people can open this solution without a problem. Is there some
> security setting that is causing me to get these errors' Help please.
> --
> LaurieT

Errors when attempting to use DataReader destination

Hi,
We have an ASP.Net app that consumes data from a SSIS package. I have proved that this works by building a noddy ASP.Net app against it on my local machine.

Unfortunately the same isn't true of our project-wide solution where we get error "Package failed to execute." In our package log I can see that the things that were failing were various property expressions that are in my package. The expressions are all on the SQLStatementSource property of various Exec SQL tasks in my package.

Here's an example of just such an error:
OnError,FR23011958,CT\aeqz,SQL UPDATE StreamHistory,{30BD52FA-8077-4D40-BFA7-248173C34000},{C84EF8C0-4B15-41FC-B205-9FB6B72884AC},26/10/2005 13:46:31,26/10/2005 13:46:31,-1073647612,0x,The result of the expression ""UPDATE dbo.StreamHistory
SET StreamEndDateID = (Year(GETDATE()) * 10000) + (Month(GETDATE()) * 100) + Day(GETDATE())
, StreamEndTimeID = (datepart(hh, GETDATE()) * 100) + datepart(mi, GETDATE())
, StreamEndTMS = GETDATE()
, StatusDetailID = 1
, Duration = DATEDIFF(ss, StreamStartTMS, GETDATE())
WHERE StreamHistoryID = " + TRIM((DT_STR, 4, 1252) @.[Metadata::StreamHistoryID])

" on property "SqlStatementSource" cannot be written to the property. The expression was evaluated, but cannot be set on the property.
Hopefully you can see that (in theory) this expression should get evaluated regardless of where the package is executed from. Remember, it is not the SQL query that fails to execute - it is the construction of the SQL statement inside an expression that fails.

So simply, has anyone experienced something similar? i.e. Expressions fail to get evaluated when a package is executed from an ASP.Net app (or elsewhere).

I'm wondering if this is a permissions thing...its damned annoying anyway.

ANY experiences at all of doing something similar would be useful.

Thanks
-Jamie

Jamie,

Would you like to share with me your package and ASP app?

BTW - I don't see how this relates to Data Reader destination. Do you mean to put another subject line instead?|||

Runying Mao wrote:

Jamie,

Would you like to share with me your package and ASP app?

BTW - I don't see how this relates to Data Reader destination. Do you mean to put another subject line instead?

Hi Runying,
Well it consumes data via a datareader. I actually wrote that initial post over the space of about an hour. At the beginning of that hour we figured the problem was in the datareader cos of the problems we've had with it lately (which you know all about Smile), by the end of the hour we'd learnt more about what it was - i.e. problems with expressions. I just forgot to change the thread title that's all.

We've found out more since. We've built a new windows forms app and copied the code from "Running an Existing Package using Visual Basic" in BOL into the app and used it to run our package. It worked fine.

We then copied and pasted that code line for line into a new project in our solution and it didn't work. Same code, same machine, same user credentials...different result. very very strange. So now we're pursuing the assumption that some sort of solution-wide configuration is causing a problem. Hopefully we'll find out more tomorrow but if not....I'l be on here pleading for help!! Smile

-Jamie|||Hi, I'm working with Jamie on this problem and have found a little more about the problem, but am still no nearer a solution!

If I add a new Web site to our solution and copy in the code to call the SSIS package, everything runs correctly.

However, if I then reference one of the other assemblies in our solution the package fails to execute, even though we're not actually calling anything in the referenced assembly.|||Here's what Tim and I eventually found out.

http://blogs.conchango.com/jamiethomson/archive/2005/10/27/2315.aspx

Weird!!

-Jamie

Friday, March 9, 2012

Errors ASP.NET to SQL Server 2005 Express Edition

If I try to use mobile web applications created with Visual Studio .NET 7.1 in conjunction with SQL Server 2005 Express Edition on my locale computer I get a lot of errors.

Examples:

System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Instance failure.

Are there known issues related to ASP.NET Mobile Controls, SQL Server 2005 Express Edition, .NET Framework 1.1 or 2.0?

Thank you.Hi,

Is the SQL Express on a different machine? If so take a look at the following blog to troubleshoot issues with a remote connection:
http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Regards,
Vikram|||Thank you for Your answer, Vikram.

But I have Visual Web Developer and SQL Server 2005 Express Edition on the same machine.|||Hi,

Have you been able to connect to the SQL Express Database using the Express Manager? What is the ConnectionString you are using ?

The default instance of SQL Server Express would need to be referenced as
.\SQLExpress or MachineName\SQLExpress

Regards,
Vikram|||Hallo Vikram,

yes, it is possible to connect with XM and the connection string fits.

From Visual Web Developer Beta 2 to SQL Server 2005 Express Edition I have the following error log with my mobile application:

2005-07-25 14:38:59.90 Logon Error: 17830, Severity: 20, State: 2.
2005-07-25 14:38:59.90 Logon A network error occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration. Time spent during login: total 7 ms, enqueued 2 ms, network writes 1 ms, network reads 4 ms, establishing SSL 5 ms, negotiating SSPI 0 ms, validating login 0 ms. [CLIENT: <local machine>]
2005-07-25 14:38:59.92 Logon Error: 17830, Severity: 20, State: 2.
2005-07-25 14:38:59.92 Logon A network error occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration. Time spent during login: total 9 ms, enqueued 1 ms, network writes 1 ms, network reads 8 ms, establishing SSL 5 ms, negotiating SSPI 0 ms, validating login 0 ms. [CLIENT: <local machine>]

I do not know why but the connection works with other applications.

I think I have to create a user for the mobile application with the right permissions.

Thank you.

Sunday, February 26, 2012

Error{no row is was updated}

hey expert out ther..

i have encounter this error ..and i dont know what is the wrong with it..

the error goes:

No row was updated

Error source: .net SQLClient Data provider

Error Message:string or binary data would be trancated.

plz help me to slove this prob.

thanks in advance!!!!!!!

Could you please provide more information, code sample causing this error?

Thanks

|||

Ehm.......there was no code thats cause this error...

It was ok when i just add data in two rows...but once i input more than 2 rows..

this error will occur!!!!!

|||

Hi

I guess you mean, that you see this error, when you put in data in tht sql management programm to the opended database table.

I have the same errormessage. There are at about 8 tables and different relations, quite a small database. When I'm trying to change table properties and klick the save button the wizard shows me the other affected tables and tells me, that there could be errors with the rowguid column. And of course there are problems and changes to the table properties aren't able.

Besides I think, that also this rowguid column has something to do with the errormessage we get, because when entering a new row, no "uniqueidentifier" is generated in the specified column of rowguid.

I hope that now someone could help us.

best regards

Hannes

Error:SqlConnection does not support parallel transactions"

This is my code in vb.net with Sql transaction
I am using insertcommand and update command for executing the sqlquery
in consecutive transactions as follows.
How can I achive parallel transactions in sql
------start of code-------
try
bID = Convert.ToInt32(Session("batchID"))
strSQL = ""
strSQL = "Insert into sessiondelayed (batchid,ActualEndDate) values (" & bID & ",'" & Format(d1, "MM/dd/yyyy") & "')"

sqlCon = New System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("conString"))


Dim s1 As String = sqlCon.ConnectionString.ToString
sqlDaEndDate = New System.Data.SqlClient.SqlDataAdapter("Select * from sessiondelayed", sqlCon)
dsEndDate = New DataSet
sqlDaEndDate.Fill(dsEndDate)

dbcommandBuilder = New SqlClient.SqlCommandBuilder(sqlDaEndDate)

'sqlCon.BeginTransaction()
'sqlDaEndDate.InsertCommand.Transaction = tr
If sqlCon.State = ConnectionState.Closed Then
sqlCon.Open()
End If
sqlDaEndDate.InsertCommand = sqlCon.CreateCommand()
tr = sqlCon.BeginTransaction(IsolationLevel.ReadCommitted)
sqlDaEndDate.InsertCommand.Connection = sqlCon
sqlDaEndDate.InsertCommand.Transaction = tr
sqlDaEndDate.InsertCommand.CommandText = strSQL
sqlDaEndDate.InsertCommand.CommandType = CommandType.Text


sqlDaEndDate.InsertCommand.ExecuteNonQuery()
tr.Commit()
sqlDaEndDate.Update(dsEndDate)
sqlCon.Close()
End If
Catch es As Exception


Dim s2 As String = es.Message
If sqlCon.State = ConnectionState.Closed Then
sqlCon.Open()
End If
strSQL = " update SessionDelayed set ActualEndDate= '" & Format(d1, "MM/dd/yyyy") & "' where batchid=" & bID & ""
sqlDaEndDate.UpdateCommand = sqlCon.CreateCommand()
tr1 = sqlCon.BeginTransaction(IsolationLevel.ReadCommitted)
sqlDaEndDate.UpdateCommand.Connection = sqlCon
sqlDaEndDate.UpdateCommand.Transaction = tr1
sqlDaEndDate.UpdateCommand.CommandText = strSQL
sqlDaEndDate.UpdateCommand.CommandType = CommandType.Text
sqlDaEndDate.UpdateCommand.ExecuteNonQuery()
tr1.Commit()
sqlDaEndDate.Update(dsEndDate)
sqlCon.Close()

End Try

'----End------

You can't since connection is basically tied to a transaction and there can be one at a time.

You either:
- use the same connection and share the same transaction
- use separate connections and therefore separate transactions

If you use v2.0 TransactionScope class might help your task.

Error:Initializing SQL Server Reconciler has failed.

My exploit environment:

VS.net 2003, SQL Server 2000 SP4, SQL Server CE 2.0 SP4

I write next codes:

Private cn As New SqlCeConnection("data source=\my documents\SQLCECF.sdf")

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

Try

If Not System.IO.File.Exists("\my documents\SQLCECF.sdf") Then

Dim en As New SqlCeEngine("data source=\my documents\SQLCECF.sdf")

en.CreateDatabase() 'create a blank database to subscribe

Synch()

End If

Catch err As SqlCeException

ShowErrors(err)

Catch err As Exception

MsgBox("There was an error:" & err.ToString())

End Try

End Sub

Sub Synch()

Try

Dim rep As SqlCeReplication = New SqlCeReplication

With rep

.Publisher = "192.168.0.222"

.PublisherDatabase = "CFLab"

.PublisherLogin = "sa"

.PublisherPassword = "sa"

.Publication = "CFLab"

.Subscriber = "SQLCENETCF"

.SubscriberConnectionString = "Provider=Microsoft.SQLServer.OLEDB.CE.2.0;Data Source=\My Documents\SQLCECF.sdf"

.InternetUrl = "http://192.168.0.222/SQLCE/sscesa20.dll"

' Create the Local SSCE Database subscription

rep.AddSubscription(AddOption.CreateDatabase)

rep.Synchronize() 'subscribe

End With

Catch err As SqlCeException

ShowErrors(err)

Finally

End Try

End Sub

Public Sub ShowErrors(ByRef e As SqlCeException)

Dim errorCollection As SqlCeErrorCollection = e.Errors

Dim bld As System.Text.StringBuilder = New System.Text.StringBuilder

Dim inner As Exception = e.InnerException

If Not inner Is Nothing Then

MessageBox.Show(("Inner Exception:" & inner.ToString()))

End If

For Each err As SqlCeError In errorCollection

bld.Append("/n Error Code: " + err.HResult.ToString("X", System.Globalization.CultureInfo.CurrentCulture))

bld.Append("/n Message : " + err.Message)

bld.Append("/n Minor Err.: " + err.NativeError.ToString())

bld.Append("/n Source : " + err.Source)

For Each numPar As Int32 In err.NumericErrorParameters

If 0 <> numPar Then

bld.Append("/n Num. Par. : " + numPar.ToString())

End If

Next

For Each errPar As String In err.ErrorParameters

If String.Empty <> errPar Then

bld.Append("/n Err. Par. : " + errPar)

End If

Next errPar

MessageBox.Show(bld.ToString())

bld.Remove(0, bld.Length)

Next err

End Sub

Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click

connect()

Dim query As String = "select * from FlightData"

Dim dap As New SqlCeDataAdapter(query, cn)

Dim dataset1 As New DataSet

dap.Fill(dataset1, "FlightData")

Disconnect()

End Sub

Sub connect()

Synch()

Try

cn.Open()

Catch err As SqlCeException

ShowErrors(err)

End Try

End Sub

Sub Disconnect()

Try

cn.Close()

Catch err As SqlCeException

ShowErrors(err)

End Try

End Sub

Private Sub dgdResults_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dgdResults.Click

End Sub

End Class

I want to synchronize the data from a SQLCE SERVER 2000

When i run the code above, the errors show:

Error Code:80045058
Message:Initializing SQL Server Reconciler has failed.

Error Code:80045058
Message:The course can't load "SSCE" Merge Replication program。please check the module wether enroll correctly.(probable description)

I do not know what's going wrong..=(
Who can help me?!!! HELP~~~~~~~~~
thanks..

Move to Sql Server Compact Edition forum.

Thanks!

|||

Please provide the exact error message, see here for instructions on how to get all error information:

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

|||

I already used the error objectsuse and listed the error information above :

Error Code:80045058
Message:Initializing SQL Server Reconciler has failed.

Error Code:80045058
Message:The course can't load "SSCE" Merge Replication program。please check the module wether enroll correctly.(probable description)

and I do not know what's going wrong

help!

|||

You should also get a native error number (5 digits), please list this, and the proper english text for this:

The course can't load "SSCE" Merge Replication program。please check the module wether enroll correctly.(probable description)

|||

I use the SQL CE of Chinese Edition, so I don't know the proper english text for that.

the text list above is which I translate into English.

thanks

|||I still do not see the native error and the error source (although it appears to be in your ShowErrors code)|||

hi, eric zhang, I met a same problem with. and NATIVE_ERROR: 29045
I'm a chinese too.So, If you have any solution, please let me share with you, thx

error:26 when connecting to sql server express...

I've got an ASP.net 2.0 application that I published and moved to a publicly available server. From my machine it works fine, but not from the production machine.

I'm attempting to connect to a machine that has sql server express installed.

The message in the browser:

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, error: 26 - Error Locating Server/Instance Specified)

So, I went by the kb article and made sure tcpip is enabled. This uses port 3288. server browser is enabled and the machine accepts remote connections.My connection string is (minus the ip & user/pwd):

<add name="IRRMAConnectionString" connectionString="Data Source=<ip_address>\SQLEXPRESS,3288;Initial Catalog=IRRMA;User ID=<user>;password=<pwd>" providerName="System.Data.SqlClient"/>

I can ping the db server from my app server. On my dev machine it connects. Windows firewall is turned off on the db server.

This seems to be an issue with a firewall, I think?

Any direction would be appreciated.

Thanks,

Scott Jones

Scott@.fourindianajones.com

You should check this out and go from there.

http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx

I would say it has to do with the UDP 1434 or the sqlbrowser.exe in the exceptions. But once you follow all the steps you should get closer to the resolution.

error:26 when connecting to sql server express...

I've got an ASP.net 2.0 application that I published and moved to a publicly available server. From my machine it works fine, but not from the production machine.

I'm attempting to connect to a machine that has sql server express installed.

The message in the browser:

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, error: 26 - Error Locating Server/Instance Specified)

So, I went by the kb article and made sure tcpip is enabled. This uses port 3288. server browser is enabled and the machine accepts remote connections.My connection string is (minus the ip & user/pwd):

<add name="IRRMAConnectionString" connectionString="Data Source=<ip_address>\SQLEXPRESS,3288;Initial Catalog=IRRMA;User ID=<user>;password=<pwd>" providerName="System.Data.SqlClient"/>

I can ping the db server from my app server. On my dev machine it connects. Windows firewall is turned off on the db server.

This seems to be an issue with a firewall, I think?

Any direction would be appreciated.

Thanks,

Scott Jones

Scott@.fourindianajones.com

You should check this out and go from there.

http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx

I would say it has to do with the UDP 1434 or the sqlbrowser.exe in the exceptions. But once you follow all the steps you should get closer to the resolution.

Friday, February 24, 2012

error:26 Error Locating Server/Instance Specified

I am having trouble connecting to Sql Server 2005 Express from asp.net
2.0 app on Windows Server 2003. I am using Sql Server Authentication,
and I tried the below article's suggestions a number of times. When I
login to to the machine, and login, I am able to get authenticated.
However, when I debug my application, I get the error below. Do I have
to give the sql server authenticaed account I created certain
permissions? Whould I set a port, and use the ipaddress rather than
the server name? Any suggestions would be greatly appreciated.
http://support.microsoft.com/kb/914277
My 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: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)
My Connection String:
<add key="ConnectionString"
value="server=MyServerName;uid=MyUserName;pwd=MyPasswd;database=MyDB"/>On Feb 1, 5:20=A0pm, carlos <carlosubu...@.gmail.com> wrote:
> I am having trouble connecting to Sql Server 2005 Express from asp.net
> 2.0 app on Windows Server 2003. I am using Sql Server Authentication,
> and I tried the below article's suggestions a number of times. When I
> login to to the machine, and login, I am able to get authenticated.
> However, when I debug my application, I get the error below. Do I have
> to give the sql server authenticaed account I created certain
> permissions? Whould I set a port, and use the ipaddress rather than
> the server name? Any suggestions would be greatly appreciated.
> http://support.microsoft.com/kb/914277
> My 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: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified)
> My Connection String:
> =A0<add key=3D"ConnectionString"
> value=3D"server=3DMyServerName;uid=3DMyUserName;pwd=3DMyPasswd;database=3D=MyDB"/>
Update:
I changed the connection string to use the ipaddress, and a port that
I set in the TCPIP settings, and now i'm getting the below 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 the default settings SQL Server does not allow remote
connections. (provider: TCP Provider, error: 0 - No connection could
be made because the target machine actively refused it.)
I'm thinking this may be a permission problem'|||Hi Carlos,
By default, SQL Server 2005 Express, Evaluation, and Developer editions
allow local client connections only. Enterprise, Standard, and Workgroup
editions also listen for remote client connections over TCP/IP.
you ned to enable Remote Connections option using
Surface Area Configuration for Services and Connections (Remote Connections)
- Database Engine
You must restart the Database Engine instance's service to apply changes.
Regards,
Amol R. Lembhe
"carlos" wrote:
> On Feb 1, 5:20 pm, carlos <carlosubu...@.gmail.com> wrote:
> > I am having trouble connecting to Sql Server 2005 Express from asp.net
> > 2.0 app on Windows Server 2003. I am using Sql Server Authentication,
> > and I tried the below article's suggestions a number of times. When I
> > login to to the machine, and login, I am able to get authenticated.
> > However, when I debug my application, I get the error below. Do I have
> > to give the sql server authenticaed account I created certain
> > permissions? Whould I set a port, and use the ipaddress rather than
> > the server name? Any suggestions would be greatly appreciated.
> >
> > http://support.microsoft.com/kb/914277
> >
> > My 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: SQL Network Interfaces, error: 26 - Error
> > Locating Server/Instance Specified)
> >
> > My Connection String:
> > <add key="ConnectionString"
> > value="server=MyServerName;uid=MyUserName;pwd=MyPasswd;database=MyDB"/>
> Update:
> I changed the connection string to use the ipaddress, and a port that
> I set in the TCPIP settings, and now i'm getting the below 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 the default settings SQL Server does not allow remote
> connections. (provider: TCP Provider, error: 0 - No connection could
> be made because the target machine actively refused it.)
> I'm thinking this may be a permission problem'
>

Error::while creating an alert in asp.net using C#

Hi,

I am creating operators,Alerts and jobs through asp.net using c#.
so some times while i am creating "Alerts" i am getting one error like this

[MicroSoft][ODBC ServerDriver][SQL Server] The specified @.Message_id('499') does not exist.

i am not understanding what its mean, any on can help me to do this

Thx,
Raj.Could you post a small standalone compileable reproduction of this issue, so we can take a closer look?

error: use trust connect failure -urgent

i use visual studio.net 2003 version and when a progamme run , it told me

do not have trust connect .what is wrong ?how can I do to solute it?

We usually define trusted connection in web.congif like

<appSettings>

<addkey="connectionstring"value="server=localhost;Trusted_Connection=true;database=databaseNamw"/>

</appSettings>

In database users --> Add ServerName\ASPNET account.

That will create trusted connection for the application.

|||

i did as you told me.but it occurs new error as follows:

" database" server of application error.

abnormity particular information: system.data.sqlclient.sqlexception"BUSA_QFDKDIEDKDJ" landing fail.

BUSA_QFDKDIEDKDJ is my server name.

|||

Hi,

I have made little web application to show you how to add user in DB with trusted connection. The DB backup is in the TestDB folder called DB backup. Make Virtual directory and browse it to TestDB folder and Restore backup in MyDB (Create it). Here is link

http://www.riseofkingdoms.com/TestDB.rar

Hope it will work. Change the server name in the string like

<appSettings>

<addkey="connectionstring"value="server=BUSA_QFDKDIEDKDJ;Trusted_Connection=true;database=MyDB"/>

</appSettings>

|||

Hi:

I change the server name ,but it doesn't work. and i am a new proqrammer,and dosen't know much, can you say easily.

|||

i use Query Decomposition to land with trusted connection,and it success.but why

it can't work in the asp.net

|||it occurs the same error.|||

Hi,

You might try checking your SQL Server - make sure you select 'Mixed' security which allows SQL Server login & password to substitute for a trusted connection.

Good luck!

|||

I change the security for 'mixed' security ,but it

occurs error: trusted connection failed.and mayby

sql server's error,because when i use Query Decomposition to land with sa and no password

,bbut it failed .what is wrong?could anyone help?

|||what's wrong ?could anyone help?|||

This problem may be due to the way you have defined your Shared Datasource. Have you stored the login Credentials or used the prompt for login option?

If you used the latter you might want to change to the store credentials option. Hope this helps

|||That's all right.Aftar I select 'Mixed' security ,I didn't restart the computer.

error: Too many arguments specified

Error:Too Many Arguments Specified
Posted: 03-03-2005 05:03 AM
Hi,
I'm pretty new to ASP.NET so I'm having some problems
I'm trying to insert a users registration info into the DB using a Stored
Proc but for some reason it won't work
When i run the Sproc in query analyser it seems to be ok with it but when i
run the asp pages it lets me enter the info then when i submit it gives me
the Too many Arguments Specified error
here's the code for the proc
CREATE PROCEDURE [dbo].[Toregister]
(
@.firstname varchar(20),
@.lastname varchar(20),
@.address varchar(20),
@.town varchar(20),
@.county varchar(20),
@.postcode varchar(10),
@.telno varchar(10),
@.email varchar(20),
@.username varchar(20),
@.password varchar(20)
)
AS
insert into t_user
(firstname,lastname,address,town,county,
postcode,telno,email,username,passwo
rd)
values
(@.firstname,@.lastname,@.address,@.town,@.co
unty,@.postcode,@.telno,@.email,@.userna
me,@.password)
GO
and here's the code in my aspx file for adding the parameters
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Save.Click
SqlCommand1.Parameters.Add("@.firstname", txtFirstname.Text)
SqlCommand1.Parameters.Add("@.lastname", txtSurname.Text)
SqlCommand1.Parameters.Add("@.address", txtAddress.Text)
SqlCommand1.Parameters.Add("@.town", txtTown.Text)
SqlCommand1.Parameters.Add("@.county", txtCounty.Text)
SqlCommand1.Parameters.Add("@.postcode", txtPostcode.Text)
SqlCommand1.Parameters.Add("@.telno", txtTelno.Text)
SqlCommand1.Parameters.Add("@.email", txtEmail.Text)
SqlCommand1.Parameters.Add("@.username", txtUsername.Text)
SqlCommand1.Parameters.Add("@.password", txtPassword.Text)
SqlConnection1.Open()
SqlCommand1.ExecuteNonQuery()
End Sub
and just for good measure here's the result from the DB profiler when I run
the asp
exec [Toregister] @.firstname = default, @.lastname = default, @.address =
default, @.town = default, @.county = default, @.postcode = default, @.telno =
default, @.email = default, @.username = default, @.password = default,
@.firstname = N'Neil', @.lastname = N'Patel', @.address = N'28 my street, @.town
= N'mytown', @.county = N'mycounty', @.postcode = N'mypostcd', @.telno =
N'01234567890, @.email = N'neil_pat@.email.com', @.username = N'neilpat',
@.password = N'neil'
I really can't see where this is going wrong
Anny suggestions welcomeMaybe the parameters already exist in the SqlParameterCollection (Look at
where SqlCommand1 is created).
Have you tried... (Warning I am not a .net programmer so my syntax may be
off).
SqlCommand1.Parameters("@.firstname").Value = txtFirstname.Text
SqlCommand1.Parameters("@.lastname").Value = txtSurname.Text
SqlCommand1.Parameters("@.address").Value = txtAddress.Text
SqlCommand1.Parameters("@.town").Value = txtTown.Text
SqlCommand1.Parameters("@.county").Value = txtCounty.Text
SqlCommand1.Parameters("@.postcode").Value = txtPostcode.Text
SqlCommand1.Parameters("@.telno").Value = txtTelno.Text
SqlCommand1.Parameters("@.email").Value = txtEmail.Text
SqlCommand1.Parameters("@.username").Value = txtUsername.Text
SqlCommand1.Parameters("@.password").Value = txtPassword.Text
"neil_pat" wrote:

> Error:Too Many Arguments Specified
> Posted: 03-03-2005 05:03 AM
> Hi,
> I'm pretty new to ASP.NET so I'm having some problems
> I'm trying to insert a users registration info into the DB using a Stored
> Proc but for some reason it won't work
> When i run the Sproc in query analyser it seems to be ok with it but when
i
> run the asp pages it lets me enter the info then when i submit it gives me
> the Too many Arguments Specified error
> here's the code for the proc
> CREATE PROCEDURE [dbo].[Toregister]
> (
> @.firstname varchar(20),
> @.lastname varchar(20),
> @.address varchar(20),
> @.town varchar(20),
> @.county varchar(20),
> @.postcode varchar(10),
> @.telno varchar(10),
> @.email varchar(20),
> @.username varchar(20),
> @.password varchar(20)
> )
> AS
> insert into t_user
> (firstname,lastname,address,town,county,
postcode,telno,email,username,pass
word)
> values
> (@.firstname,@.lastname,@.address,@.town,@.co
unty,@.postcode,@.telno,@.email,@.user
name,@.password)
> GO
> and here's the code in my aspx file for adding the parameters
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Save.Click
>
> SqlCommand1.Parameters.Add("@.firstname", txtFirstname.Text)
> SqlCommand1.Parameters.Add("@.lastname", txtSurname.Text)
> SqlCommand1.Parameters.Add("@.address", txtAddress.Text)
> SqlCommand1.Parameters.Add("@.town", txtTown.Text)
> SqlCommand1.Parameters.Add("@.county", txtCounty.Text)
> SqlCommand1.Parameters.Add("@.postcode", txtPostcode.Text)
> SqlCommand1.Parameters.Add("@.telno", txtTelno.Text)
> SqlCommand1.Parameters.Add("@.email", txtEmail.Text)
> SqlCommand1.Parameters.Add("@.username", txtUsername.Text)
> SqlCommand1.Parameters.Add("@.password", txtPassword.Text)
> SqlConnection1.Open()
> SqlCommand1.ExecuteNonQuery()
> End Sub
>
> and just for good measure here's the result from the DB profiler when I ru
n
> the asp
> exec [Toregister] @.firstname = default, @.lastname = default, @.address =
> default, @.town = default, @.county = default, @.postcode = default, @.telno =
> default, @.email = default, @.username = default, @.password = default,
> @.firstname = N'Neil', @.lastname = N'Patel', @.address = N'28 my street, @.to
wn
> = N'mytown', @.county = N'mycounty', @.postcode = N'mypostcd', @.telno =
> N'01234567890, @.email = N'neil_pat@.email.com', @.username = N'neilpat',
> @.password = N'neil'
> I really can't see where this is going wrong
> Anny suggestions welcome
>

error: too many arguments specified

Error:Too Many Arguments Specified
Posted: 03-03-2005 05:03 AM
Hi,
I'm pretty new to ASP.NET so I'm having some problems
I'm trying to insert a users registration info into the DB using a Stored
Proc but for some reason it won't work
When i run the Sproc in query analyser it seems to be ok with it but when i
run the asp pages it lets me enter the info then when i submit it gives me
the Too many Arguments Specified error
here's the code for the proc
CREATE PROCEDURE [dbo].[Toregister]
(
@.firstname varchar(20),
@.lastname varchar(20),
@.address varchar(20),
@.town varchar(20),
@.county varchar(20),
@.postcode varchar(10),
@.telno varchar(10),
@.email varchar(20),
@.username varchar(20),
@.password varchar(20)
)
AS
insert into t_user
(firstname,lastname,address,town,county,
postcode,telno,email,username,passwo
rd)
values
(@.firstname,@.lastname,@.address,@.town,@.co
unty,@.postcode,@.telno,@.email,@.userna
me,@.password)
GO
and here's the code in my aspx file for adding the parameters
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Save.Click
SqlCommand1.Parameters.Add("@.firstname", txtFirstname.Text)
SqlCommand1.Parameters.Add("@.lastname", txtSurname.Text)
SqlCommand1.Parameters.Add("@.address", txtAddress.Text)
SqlCommand1.Parameters.Add("@.town", txtTown.Text)
SqlCommand1.Parameters.Add("@.county", txtCounty.Text)
SqlCommand1.Parameters.Add("@.postcode", txtPostcode.Text)
SqlCommand1.Parameters.Add("@.telno", txtTelno.Text)
SqlCommand1.Parameters.Add("@.email", txtEmail.Text)
SqlCommand1.Parameters.Add("@.username", txtUsername.Text)
SqlCommand1.Parameters.Add("@.password", txtPassword.Text)
SqlConnection1.Open()
SqlCommand1.ExecuteNonQuery()
End Sub
and just for good measure here's the result from the DB profiler when I run
the asp
exec [Toregister] @.firstname = default, @.lastname = default, @.address =
default, @.town = default, @.county = default, @.postcode = default, @.telno =
default, @.email = default, @.username = default, @.password = default,
@.firstname = N'Neil', @.lastname = N'Patel', @.address = N'28 my street, @.town
= N'mytown', @.county = N'mycounty', @.postcode = N'mypostcd', @.telno =
N'01234567890, @.email = N'neil_pat@.email.com', @.username = N'neilpat',
@.password = N'neil'
I really can't see where this is going wrong
Anny suggestions welcomeActually there are only 10 parameters to be passed.
exec [Toregister] @.firstname = default, @.lastname = default, @.address =
default, @.town = default, @.county = default, @.postcode = default,
@.telno
= default, @.email = default, @.username = default, @.password = default,
@.firstname = N'Neil', @.lastname = N'Patel', @.address = N'28 my street,
@.town = N'mytown', @.county = N'mycounty', @.postcode = N'mypostcd',
@.telno = N'01234567890, @.email = N'neil_...@.email.com', @.username =
N'neilpat', @.password = N'neil'
You passed more than 10
Madhivanan|||Look at the profiler trace. It is passing all the parameters as default
folowed by all the parameters with values - hence 20 parameters instead of 1
0.
I suspect when you build the command you are getting the parameters for the
sp then adding them again.
"neil_pat" wrote:

> Error:Too Many Arguments Specified
> Posted: 03-03-2005 05:03 AM
> Hi,
> I'm pretty new to ASP.NET so I'm having some problems
> I'm trying to insert a users registration info into the DB using a Stored
> Proc but for some reason it won't work
> When i run the Sproc in query analyser it seems to be ok with it but when
i
> run the asp pages it lets me enter the info then when i submit it gives me
> the Too many Arguments Specified error
> here's the code for the proc
> CREATE PROCEDURE [dbo].[Toregister]
> (
> @.firstname varchar(20),
> @.lastname varchar(20),
> @.address varchar(20),
> @.town varchar(20),
> @.county varchar(20),
> @.postcode varchar(10),
> @.telno varchar(10),
> @.email varchar(20),
> @.username varchar(20),
> @.password varchar(20)
> )
> AS
> insert into t_user
> (firstname,lastname,address,town,county,
postcode,telno,email,username,pass
word)
> values
> (@.firstname,@.lastname,@.address,@.town,@.co
unty,@.postcode,@.telno,@.email,@.user
name,@.password)
> GO
> and here's the code in my aspx file for adding the parameters
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Save.Click
>
> SqlCommand1.Parameters.Add("@.firstname", txtFirstname.Text)
> SqlCommand1.Parameters.Add("@.lastname", txtSurname.Text)
> SqlCommand1.Parameters.Add("@.address", txtAddress.Text)
> SqlCommand1.Parameters.Add("@.town", txtTown.Text)
> SqlCommand1.Parameters.Add("@.county", txtCounty.Text)
> SqlCommand1.Parameters.Add("@.postcode", txtPostcode.Text)
> SqlCommand1.Parameters.Add("@.telno", txtTelno.Text)
> SqlCommand1.Parameters.Add("@.email", txtEmail.Text)
> SqlCommand1.Parameters.Add("@.username", txtUsername.Text)
> SqlCommand1.Parameters.Add("@.password", txtPassword.Text)
> SqlConnection1.Open()
> SqlCommand1.ExecuteNonQuery()
> End Sub
>
> and just for good measure here's the result from the DB profiler when I ru
n
> the asp
> exec [Toregister] @.firstname = default, @.lastname = default, @.address =
> default, @.town = default, @.county = default, @.postcode = default, @.telno =
> default, @.email = default, @.username = default, @.password = default,
> @.firstname = N'Neil', @.lastname = N'Patel', @.address = N'28 my street, @.to
wn
> = N'mytown', @.county = N'mycounty', @.postcode = N'mypostcd', @.telno =
> N'01234567890, @.email = N'neil_pat@.email.com', @.username = N'neilpat',
> @.password = N'neil'
> I really can't see where this is going wrong
> Anny suggestions welcome
>|||Could you just explain that? iDo you mean that its counting each one
seprately i.e. 20 instead of 10?
How do i rectify this?
"Madhivanan" wrote:

> Actually there are only 10 parameters to be passed.
> exec [Toregister] @.firstname = default, @.lastname = default, @.address =
> default, @.town = default, @.county = default, @.postcode = default,
> @.telno
> = default, @.email = default, @.username = default, @.password = default,
> @.firstname = N'Neil', @.lastname = N'Patel', @.address = N'28 my street,
> @.town = N'mytown', @.county = N'mycounty', @.postcode = N'mypostcd',
> @.telno = N'01234567890, @.email = N'neil_...@.email.com', @.username =
> N'neilpat', @.password = N'neil'
> You passed more than 10
> Madhivanan
>|||Sorry I'm a bit of a beginer.
Which bit of my code do i need to edit to stop this?
"Nigel Rivett" wrote:
> Look at the profiler trace. It is passing all the parameters as default
> folowed by all the parameters with values - hence 20 parameters instead of
10.
> I suspect when you build the command you are getting the parameters for th
e
> sp then adding them again.
> "neil_pat" wrote:
>|||Have a look at
http://www.mindsdoor.net/DOTNET/DotNetDBAccess.html
It gives a database access layer and includes creation of all the objects.
I suspect you are binding sqlcommand1 to the sp before adding the parameters
.
"neil_pat" wrote:
> Sorry I'm a bit of a beginer.
> Which bit of my code do i need to edit to stop this?
> "Nigel Rivett" wrote:
>|||Remove all the fields with default values
Madhivanan|||I managed to sort it out now.
VS.net was adding default parameters automatically which i removed and it
works fine now
Thanks
"neil_pat" wrote:

> Error:Too Many Arguments Specified
> Posted: 03-03-2005 05:03 AM
> Hi,
> I'm pretty new to ASP.NET so I'm having some problems
> I'm trying to insert a users registration info into the DB using a Stored
> Proc but for some reason it won't work
> When i run the Sproc in query analyser it seems to be ok with it but when
i
> run the asp pages it lets me enter the info then when i submit it gives me
> the Too many Arguments Specified error
> here's the code for the proc
> CREATE PROCEDURE [dbo].[Toregister]
> (
> @.firstname varchar(20),
> @.lastname varchar(20),
> @.address varchar(20),
> @.town varchar(20),
> @.county varchar(20),
> @.postcode varchar(10),
> @.telno varchar(10),
> @.email varchar(20),
> @.username varchar(20),
> @.password varchar(20)
> )
> AS
> insert into t_user
> (firstname,lastname,address,town,county,
postcode,telno,email,username,pass
word)
> values
> (@.firstname,@.lastname,@.address,@.town,@.co
unty,@.postcode,@.telno,@.email,@.user
name,@.password)
> GO
> and here's the code in my aspx file for adding the parameters
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Save.Click
>
> SqlCommand1.Parameters.Add("@.firstname", txtFirstname.Text)
> SqlCommand1.Parameters.Add("@.lastname", txtSurname.Text)
> SqlCommand1.Parameters.Add("@.address", txtAddress.Text)
> SqlCommand1.Parameters.Add("@.town", txtTown.Text)
> SqlCommand1.Parameters.Add("@.county", txtCounty.Text)
> SqlCommand1.Parameters.Add("@.postcode", txtPostcode.Text)
> SqlCommand1.Parameters.Add("@.telno", txtTelno.Text)
> SqlCommand1.Parameters.Add("@.email", txtEmail.Text)
> SqlCommand1.Parameters.Add("@.username", txtUsername.Text)
> SqlCommand1.Parameters.Add("@.password", txtPassword.Text)
> SqlConnection1.Open()
> SqlCommand1.ExecuteNonQuery()
> End Sub
>
> and just for good measure here's the result from the DB profiler when I ru
n
> the asp
> exec [Toregister] @.firstname = default, @.lastname = default, @.address =
> default, @.town = default, @.county = default, @.postcode = default, @.telno =
> default, @.email = default, @.username = default, @.password = default,
> @.firstname = N'Neil', @.lastname = N'Patel', @.address = N'28 my street, @.to
wn
> = N'mytown', @.county = N'mycounty', @.postcode = N'mypostcd', @.telno =
> N'01234567890, @.email = N'neil_pat@.email.com', @.username = N'neilpat',
> @.password = N'neil'
> I really can't see where this is going wrong
> Anny suggestions welcome
>|||I've sorted it now
VS.Net was adding default parameters automatically. I've removed them and it
works fine now
"Nigel Rivett" wrote:
> Have a look at
> http://www.mindsdoor.net/DOTNET/DotNetDBAccess.html
> It gives a database access layer and includes creation of all the objects.
> I suspect you are binding sqlcommand1 to the sp before adding the paramete
rs.
> "neil_pat" wrote:
>

Friday, February 17, 2012

Error: Subreport could not be shown. : A report with only one subreport

Hello,
I created a simple report that just one item in it, a subreport. If I
run the report in my .Net Visual Studio, the report displays ok with the
subreport. When I deploy the report to the report server, the report
displays "Error: Subreport could not be shown. " message.
The main report has no parameters and the subreport's parameters are set
using the Subreport Properties dialog.
Is this a bug? What is the work around?
SteveThe main report has no datasets it is pretty much almost an empty report
except for the subreport.
The subreport has at least 4 additional subreports inside itself.
It seems if the subreport doesn't contain internal subreports inside then I
don't get the error.
"steve kwon" <steven,kwon@.lmco.com> wrote in message
news:Owxae%23CrFHA.2624@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I created a simple report with just one item in it, a subreport. If I
> run the report in my .Net Visual Studio, the report displays ok with the
> subreport. When I deploy the report to the report server, the report
> displays "Error: Subreport could not be shown. " message.
> The main report has no parameters and the subreport's parameters are
> set using the Subreport Properties dialog.
> Is this a bug? What is the work around?
> Steve
>