Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Tuesday, March 20, 2012

[Stored Procedures] How do I calculate 3^1.2?

Hello,

I am working with SQL Server 2005 stored procedures.

How do I do this:
SET @.MyAnswer = 3^1.2
--i.e. 3 to the 1.2 power

Currently it will not allow it because"The data types int and numeric are incompatible in the boolean XOR operator."

~Le

I think you must use FLOAT to use all or most of the mathematical functions and cast the result to Numeric. Hope this helps.

http://msdn2.microsoft.com/en-US/library/ms177516.aspx

|||

Caddre:

I think you must use FLOAT to use all or most of the mathematical function and cast the result to Numeric. Hope this helps.

http://msdn2.microsoft.com/en-US/library/ms177516.aspx

Excellent! That put me on the right path.

The correct function is:POWER(x,y)

and the key wasx.

Power (1.0000, 1) will return 1.0000
Power (1.00, 1) will return 1.00

Thanks!

`Le

Sunday, March 11, 2012

[rsRuntimeErrorInExpression] The Value expression for the textbox

Hey All,
I am hoping that I will get a speedy response to this problem. I am working
in RS in SQL 2005. I have a report that has 6 parameters, 3 of these are
multivalue. They work fine, with the following exception:
I'm trying to set an expression in a text box on the report, to display back
to the users which parameters they selected prior to viewing the report.
This works fine for non-multivalue parameters. But, with the multivalue
parameters, I keep getting an error about the '&' not being valid. The
report builds fine, it only errors when I try to preview the report.
Here's the expression in my textbox:
="Report Parameters Entered:" & vbCrLf & "Retailer: " &
Parameters!Retailer.Value & vbCrLf & "Month/Year: " & Parameters!Month.Value
& "/" & Parameters!Year.Value & vbCrLf & "Store(s): " &
Parameters!StoreID.Value & vbCrLf & "Super Categories: " &
Parameters!SuperCategory.Value & vbCrLf & "Managed Indicator: " &
Parameters!Managed.Value
If I change the parameters in this to .IsMultiValue (for the ones that are
multivalue), the report runs fine. But, the actual values selected are not
returned. What shows up in the report is 'True' for each of the multivalue
parameters (because they are multivalue and I'm using the IsMultiValue?).
Anyway, if anyone knows of a work around for this, or if I am just way off
base...PLEASE let me know as soon as possible.
Thanks so much for your response!
SandiMaybe this tip helps?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=481987&SiteID=1
Kaisa M. Lindahl Lervik
"SandiB" <SandiB@.discussions.microsoft.com> wrote in message
news:C87FE985-C985-4C3F-B047-53338EFF7A41@.microsoft.com...
> Hey All,
> I am hoping that I will get a speedy response to this problem. I am
> working
> in RS in SQL 2005. I have a report that has 6 parameters, 3 of these are
> multivalue. They work fine, with the following exception:
> I'm trying to set an expression in a text box on the report, to display
> back
> to the users which parameters they selected prior to viewing the report.
> This works fine for non-multivalue parameters. But, with the multivalue
> parameters, I keep getting an error about the '&' not being valid. The
> report builds fine, it only errors when I try to preview the report.
> Here's the expression in my textbox:
> ="Report Parameters Entered:" & vbCrLf & "Retailer: " &
> Parameters!Retailer.Value & vbCrLf & "Month/Year: " &
> Parameters!Month.Value
> & "/" & Parameters!Year.Value & vbCrLf & "Store(s): " &
> Parameters!StoreID.Value & vbCrLf & "Super Categories: " &
> Parameters!SuperCategory.Value & vbCrLf & "Managed Indicator: " &
> Parameters!Managed.Value
> If I change the parameters in this to .IsMultiValue (for the ones that are
> multivalue), the report runs fine. But, the actual values selected are
> not
> returned. What shows up in the report is 'True' for each of the
> multivalue
> parameters (because they are multivalue and I'm using the IsMultiValue?).
> Anyway, if anyone knows of a work around for this, or if I am just way off
> base...PLEASE let me know as soon as possible.
> Thanks so much for your response!
> Sandi|||Thanks so much! This worked perfectly!
"Kaisa M. Lindahl Lervik" wrote:
> Maybe this tip helps?
> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=481987&SiteID=1
> Kaisa M. Lindahl Lervik
> "SandiB" <SandiB@.discussions.microsoft.com> wrote in message
> news:C87FE985-C985-4C3F-B047-53338EFF7A41@.microsoft.com...
> > Hey All,
> >
> > I am hoping that I will get a speedy response to this problem. I am
> > working
> > in RS in SQL 2005. I have a report that has 6 parameters, 3 of these are
> > multivalue. They work fine, with the following exception:
> >
> > I'm trying to set an expression in a text box on the report, to display
> > back
> > to the users which parameters they selected prior to viewing the report.
> > This works fine for non-multivalue parameters. But, with the multivalue
> > parameters, I keep getting an error about the '&' not being valid. The
> > report builds fine, it only errors when I try to preview the report.
> >
> > Here's the expression in my textbox:
> >
> > ="Report Parameters Entered:" & vbCrLf & "Retailer: " &
> > Parameters!Retailer.Value & vbCrLf & "Month/Year: " &
> > Parameters!Month.Value
> > & "/" & Parameters!Year.Value & vbCrLf & "Store(s): " &
> > Parameters!StoreID.Value & vbCrLf & "Super Categories: " &
> > Parameters!SuperCategory.Value & vbCrLf & "Managed Indicator: " &
> > Parameters!Managed.Value
> >
> > If I change the parameters in this to .IsMultiValue (for the ones that are
> > multivalue), the report runs fine. But, the actual values selected are
> > not
> > returned. What shows up in the report is 'True' for each of the
> > multivalue
> > parameters (because they are multivalue and I'm using the IsMultiValue?).
> >
> > Anyway, if anyone knows of a work around for this, or if I am just way off
> > base...PLEASE let me know as soon as possible.
> >
> > Thanks so much for your response!
> >
> > Sandi
>
>|||'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\ISOJC111\ISOJC\bin\Debug\ISOJC.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine\10.2.3600.0__692fbea5521e1304\CrystalDecisions.CrystalReports.Engine.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC\CrystalDecisions.Enterprise.Framework\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Enterprise.Framework.dll', No symbols loaded.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC\CrystalDecisions.Enterprise.InfoStore\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Enterprise.InfoStore.dll', No symbols loaded.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.ReportSource\10.2.3600.0__692fbea5521e1304\CrystalDecisions.ReportSource.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Shared\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Shared.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Windows.Forms\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\8.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.Common.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms\8.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WinForms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasic.PowerPacks\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.PowerPacks.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasic\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x12ac has exited with code 0 (0x0).
The thread 0x1650 has exited with code 0 (0x0).
The thread 0xdc has exited with code 0 (0x0).
'ISOJC.vshost.exe' (Managed): Loaded 'C:\ISOJC111\ISOJC\bin\Debug\ISOJC.exe', Symbols loaded.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\8.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.ProcessingObjectModel.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ISOJC.vshost.exe' (Managed): Loaded 'expression_host_10e7fe2ca2834f48ab7700ebecf77268', No symbols loaded.
Warning: The Value expression for the textbox ?textbox27? contains an error: Input string was not in a correct format. (rsRuntimeErrorInExpression)
The thread 0x1730 has exited with code 0 (0x0).
Warning: The Value expression for the textbox ?textbox27? contains an error: Input string was not in a correct format. (rsRuntimeErrorInExpression)
The thread 0x380 has exited with code 0 (0x0).
Warning: The Value expression for the textbox ?textbox27? contains an error: Input string was not in a correct format. (rsRuntimeErrorInExpression)
The thread 0xd24 has exited with code 0 (0x0).
The thread 0x17ec has exited with code 0 (0x0).
The thread 0x133c has exited with code 0 (0x0).
The program '[5820] ISOJC.vshost.exe: Managed' has exited with code 0 (0x0).
From http://www.google.co.in/search?q=rsRuntimeErrorInExpression&hl=en&start=10&sa=N
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Tuesday, March 6, 2012

[Named Pipes]Specified Sql server not found]

I am trying to create Sql Server 2000 remotely using and getting following e
rror on some of the machine, but on some of the machine it is working fine.
All client machine having W2K Prof.
"[Microsoft[[ODBC Sql Server Driver][Named Pipes]Specified S
ql server not found"
Server alias/client using TCP/IP utility. Earlier it was working fine on all
the machine. I only installed Sql Server SP3a, after that it is starting gi
vig the problem.
Let me khow do I handle this.
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.693 / Virus Database: 454 - Release Date: 05/31/2004I sort out the problem, by installing MDAC 2.8. Now it is working fine.
"Ashish Kanoongo" <ashishk@.armour.com> wrote in message news:OwSuidHSEHA.139
2@.TK2MSFTNGP09.phx.gbl...
I am trying to create Sql Server 2000 remotely using and getting following e
rror on some of the machine, but on some of the machine it is working fine.
All client machine having W2K Prof.
"[Microsoft[[ODBC Sql Server Driver][Named Pipes]Specified S
ql server not found"
Server alias/client using TCP/IP utility. Earlier it was working fine on all
the machine. I only installed Sql Server SP3a, after that it is starting gi
vig the problem.
Let me khow do I handle this.
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.693 / Virus Database: 454 - Release Date: 05/31/2004|||Get the actual OS Error number. Example if the Error is 53, then the error
is Network Name not Found. Usually a WINS issue.
Test with a ODBC DSN to get the entire error message and re-post it here.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

[Named Pipes]Specified Sql server not found]

I am trying to create Sql Server 2000 remotely using and getting following error on some of the machine, but on some of the machine it is working fine. All client machine having W2K Prof.
"[Microsoft[[ODBC Sql Server Driver][Named Pipes]Specified Sql server not found"
Server alias/client using TCP/IP utility. Earlier it was working fine on all the machine. I only installed Sql Server SP3a, after that it is starting givig the problem.
Let me khow do I handle this.
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.693 / Virus Database: 454 - Release Date: 05/31/2004
I sort out the problem, by installing MDAC 2.8. Now it is working fine.
"Ashish Kanoongo" <ashishk@.armour.com> wrote in message news:OwSuidHSEHA.1392@.TK2MSFTNGP09.phx.gbl...
I am trying to create Sql Server 2000 remotely using and getting following error on some of the machine, but on some of the machine it is working fine. All client machine having W2K Prof.
"[Microsoft[[ODBC Sql Server Driver][Named Pipes]Specified Sql server not found"
Server alias/client using TCP/IP utility. Earlier it was working fine on all the machine. I only installed Sql Server SP3a, after that it is starting givig the problem.
Let me khow do I handle this.
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.693 / Virus Database: 454 - Release Date: 05/31/2004
|||Get the actual OS Error number. Example if the Error is 53, then the error
is Network Name not Found. Usually a WINS issue.
Test with a ODBC DSN to get the entire error message and re-post it here.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

[Microsoft][ODBC SQL Server Driver]Timeout expired

Hi,
[Microsoft][ODBC SQL Server Driver]Timeout expired
I am getting the above error all the time:
In are old verison of the App it is not working.
The query is updating are table that has varchar(8000) columns and text(16)
columns.
Is there anything I can do to make this run faster. If you run the whole
query in SQL Analyzer it runs in milliseconds, but through the ASP pages that
are updating a record it Timeouts. And it is only happening to this one
table, we have other similar tables that have text and large varchars, that
run in are ASP pages just fine.
Thanks,
MattHi
Whist it is running, run sp_who2
Check for blocked processes
Looks like you have processes blocking each other so eventually the query
times out.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jaffa" <Jaffa@.discussions.microsoft.com> wrote in message
news:EE8F55E6-C237-4262-920D-B0E889DE29CD@.microsoft.com...
> Hi,
> [Microsoft][ODBC SQL Server Driver]Timeout expired
>
> I am getting the above error all the time:
> In are old verison of the App it is not working.
> The query is updating are table that has varchar(8000) columns and
text(16)
> columns.
> Is there anything I can do to make this run faster. If you run the whole
> query in SQL Analyzer it runs in milliseconds, but through the ASP pages
that
> are updating a record it Timeouts. And it is only happening to this one
> table, we have other similar tables that have text and large varchars,
that
> run in are ASP pages just fine.
> Thanks,
> Matt
>|||Can you post the DDL for the table and exactly how you are updating the row?
--
Andrew J. Kelly SQL MVP
"Jaffa" <Jaffa@.discussions.microsoft.com> wrote in message
news:EE8F55E6-C237-4262-920D-B0E889DE29CD@.microsoft.com...
> Hi,
> [Microsoft][ODBC SQL Server Driver]Timeout expired
>
> I am getting the above error all the time:
> In are old verison of the App it is not working.
> The query is updating are table that has varchar(8000) columns and
> text(16)
> columns.
> Is there anything I can do to make this run faster. If you run the whole
> query in SQL Analyzer it runs in milliseconds, but through the ASP pages
> that
> are updating a record it Timeouts. And it is only happening to this one
> table, we have other similar tables that have text and large varchars,
> that
> run in are ASP pages just fine.
> Thanks,
> Matt
>

[Microsoft][ODBC SQL Server Driver]Timeout expired

Hi,
[Microsoft][ODBC SQL Server Driver]Timeout expired
I am getting the above error all the time:
In are old verison of the App it is not working.
The query is updating are table that has varchar(8000) columns and text(16)
columns.
Is there anything I can do to make this run faster. If you run the whole
query in SQL Analyzer it runs in milliseconds, but through the ASP pages that
are updating a record it Timeouts. And it is only happening to this one
table, we have other similar tables that have text and large varchars, that
run in are ASP pages just fine.
Thanks,
Matt
Hi
Whist it is running, run sp_who2
Check for blocked processes
Looks like you have processes blocking each other so eventually the query
times out.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jaffa" <Jaffa@.discussions.microsoft.com> wrote in message
news:EE8F55E6-C237-4262-920D-B0E889DE29CD@.microsoft.com...
> Hi,
> [Microsoft][ODBC SQL Server Driver]Timeout expired
>
> I am getting the above error all the time:
> In are old verison of the App it is not working.
> The query is updating are table that has varchar(8000) columns and
text(16)
> columns.
> Is there anything I can do to make this run faster. If you run the whole
> query in SQL Analyzer it runs in milliseconds, but through the ASP pages
that
> are updating a record it Timeouts. And it is only happening to this one
> table, we have other similar tables that have text and large varchars,
that
> run in are ASP pages just fine.
> Thanks,
> Matt
>
|||Can you post the DDL for the table and exactly how you are updating the row?
Andrew J. Kelly SQL MVP
"Jaffa" <Jaffa@.discussions.microsoft.com> wrote in message
news:EE8F55E6-C237-4262-920D-B0E889DE29CD@.microsoft.com...
> Hi,
> [Microsoft][ODBC SQL Server Driver]Timeout expired
>
> I am getting the above error all the time:
> In are old verison of the App it is not working.
> The query is updating are table that has varchar(8000) columns and
> text(16)
> columns.
> Is there anything I can do to make this run faster. If you run the whole
> query in SQL Analyzer it runs in milliseconds, but through the ASP pages
> that
> are updating a record it Timeouts. And it is only happening to this one
> table, we have other similar tables that have text and large varchars,
> that
> run in are ASP pages just fine.
> Thanks,
> Matt
>

Saturday, February 25, 2012

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name

hi
i m connect to the sQL SERVER using system DSN in JREPORT
but it is not working
get the following error
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name

Quote:

Originally Posted by daxter

hi
i m connect to the sQL SERVER using system DSN in JREPORT
but it is not working
get the following error
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name


Try using

\Control Panel\Administrative Tools\Data Sources (ODBC)

And System DNS tab up the top of that window

Friday, February 24, 2012

[HELP!] How do you make the database path relative in the connection string?

Hi everyone,

I am working on a Hospital Information System project with a team of 6.Each one of us builds or modifies a part of the system and shares the project over a common repository. The problem here is that we use the absolute path of the database in our connection string. Although the directory structure of our project is the same for each member, since the main project folder itself is stored in different locations on each person's computer (for example, one may have it stored in c:\My Documents and the other in d:\ My Documents), we are forced to modify the connection string manually each time someone else from the team updates the repository with the database. How do we make the path of the database relative so that we don't have to modify the connection string manually each time after receiving an update from the repository?

Your help is greatly appreciated.

If you're referencing the path, then I wonder what database you are using. e.g. for MSSQL you would refer to a server and the database on that server, generally just '.' for a local server

Lot's of ways you could do this, e.g. I've just been playing with clickonce install and this is one I use;

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\dbRaptor_Data.mdf;Integrated Security=True;User Instance=True"

Thursday, February 16, 2012

[DBNetLib] ConnectionOpen error

I have a working SQL Server 2000. I use Citrix to run Terminal Server
Apps which work Fine. If I use RDP instead of ICA (Citrix) using the
same app and the same user, I get
an error as follows:
"[DBNetLib] ConnectionOpen(Connect) SQL Server does not exist or access
is denied."
As I said , the same App and Same User work fine if I ICA int the box.
THe Only diff is When I RDP into the same box.
An Domain ADMIN will work using both RDP and ICA. Other users will work
in ICA but not RDP.
Anyone have a suggestion where I can look?
jwc
*** Sent via Developersdex http://www.codecomments.com ***
Jim Bob wrote:
> I have a working SQL Server 2000. I use Citrix to run Terminal Server
> Apps which work Fine. If I use RDP instead of ICA (Citrix) using the
> same app and the same user, I get
> an error as follows:
> "[DBNetLib] ConnectionOpen(Connect) SQL Server does not exist or access
> is denied."
> As I said , the same App and Same User work fine if I ICA int the box.
> THe Only diff is When I RDP into the same box.
> An Domain ADMIN will work using both RDP and ICA. Other users will work
> in ICA but not RDP.
> Anyone have a suggestion where I can look?
> jwc
Are you doing remote desktop with rdp or using rdp inside citrix for a
published App? And whats with ica? remote desktop or directly a
published App?
early guess:
Please check the terminal Server / Citrix Server local users. Maybe the
account you are using exists as a local and a domain user and rdp is
using the local account insead of the domain account.
hth
Gregor Stefka
|||I am using a thin client and the RDP protocol (No Citrix).
It seems to be a permission thing possible with DCOM. Are you familiar
with dcomcnfg and How I can use it to grant the proper permissions?
jwc
*** Sent via Developersdex http://www.codecomments.com ***
|||Jim Bob wrote:
> I am using a thin client and the RDP protocol (No Citrix).
> It seems to be a permission thing possible with DCOM. Are you familiar
> with dcomcnfg and How I can use it to grant the proper permissions?
>
Just start dcomcnfg select the component you want to alter the
permissions for. After that you may need to restart the Service/component.
What kind of application you are using? MS Office? individual software?
hth
Stefka
|||It is an internal app that uses a backend SQL Database. The SQL
Database in on another server
jwc
*** Sent via Developersdex http://www.codecomments.com ***
|||OK I have narrowed it down a bit. If I RDP into the Terminal Server
with a Thin Client, I get the error. If I RDP with the same user on the
Terminal Server console and run the App, it works fine.
What is the difference here?
jwc
*** Sent via Developersdex http://www.codecomments.com ***

[DBNetLib] ConnectionOpen error

I have a working SQL Server 2000. I use Citrix to run Terminal Server
Apps which work Fine. If I use RDP instead of ICA (Citrix) using the
same app and the same user, I get
an error as follows:
"[DBNetLib] ConnectionOpen(Connect) SQL Server does not exist or access
is denied."
As I said , the same App and Same User work fine if I ICA int the box.
THe Only diff is When I RDP into the same box.
An Domain ADMIN will work using both RDP and ICA. Other users will work
in ICA but not RDP.
Anyone have a suggestion where I can look?
jwc
*** Sent via Developersdex http://www.codecomments.com ***Jim Bob wrote:
> I have a working SQL Server 2000. I use Citrix to run Terminal Server
> Apps which work Fine. If I use RDP instead of ICA (Citrix) using the
> same app and the same user, I get
> an error as follows:
> "[DBNetLib] ConnectionOpen(Connect) SQL Server does not exist or acce
ss
> is denied."
> As I said , the same App and Same User work fine if I ICA int the box.
> THe Only diff is When I RDP into the same box.
> An Domain ADMIN will work using both RDP and ICA. Other users will work
> in ICA but not RDP.
> Anyone have a suggestion where I can look?
> jwc
Are you doing remote desktop with rdp or using rdp inside citrix for a
published App? And whats with ica? remote desktop or directly a
published App?
early guess:
Please check the terminal Server / Citrix Server local users. Maybe the
account you are using exists as a local and a domain user and rdp is
using the local account insead of the domain account.
hth
Gregor Stefka|||I am using a thin client and the RDP protocol (No Citrix).
It seems to be a permission thing possible with DCOM. Are you familiar
with dcomcnfg and How I can use it to grant the proper permissions?
jwc
*** Sent via Developersdex http://www.codecomments.com ***|||Jim Bob wrote:
> I am using a thin client and the RDP protocol (No Citrix).
> It seems to be a permission thing possible with DCOM. Are you familiar
> with dcomcnfg and How I can use it to grant the proper permissions?
>
Just start dcomcnfg select the component you want to alter the
permissions for. After that you may need to restart the Service/component.
What kind of application you are using? MS Office? individual software?
hth
Stefka|||It is an internal app that uses a backend SQL Database. The SQL
Database in on another server
jwc
*** Sent via Developersdex http://www.codecomments.com ***|||OK I have narrowed it down a bit. If I RDP into the Terminal Server
with a Thin Client, I get the error. If I RDP with the same user on the
Terminal Server console and run the App, it works fine.
What is the difference here?
jwc
*** Sent via Developersdex http://www.codecomments.com ***

[DBMSSOCN]General network error.

We've recently rebuilt our database and we're running an ASP front end.
Everything was working just fine today until about 15 minutes ago when no
one could search the database and when they attempted to do so, they
received the following error:
"[DBMSSOCN]General network error. Check your network settings ..."
I found a MSKB article on this but it didn't seem to be relevant. Any idea
what could be causing this? This is the 2nd time in as many days that the
site has worked for the majority of the day and then all of a sudden
crashed. I believe this has something to do with the way I'm connecting to
the SQL server.
Thanks!
James
Hi,
could you please write a configuration of the server (OS, etc.).
It could be a problem with Named Pipes.
Danijel
"James" <cppjames@.aol.com> wrote in message
news:%23RL5cs28EHA.2600@.TK2MSFTNGP09.phx.gbl...
> We've recently rebuilt our database and we're running an ASP front end.
> Everything was working just fine today until about 15 minutes ago when no
> one could search the database and when they attempted to do so, they
> received the following error:
> "[DBMSSOCN]General network error. Check your network settings ..."
> I found a MSKB article on this but it didn't seem to be relevant. Any
> idea
> what could be causing this? This is the 2nd time in as many days that the
> site has worked for the majority of the day and then all of a sudden
> crashed. I believe this has something to do with the way I'm connecting
> to
> the SQL server.
> Thanks!
> James
>
|||SQL Server 2000, Windows 2003. Thanks for the suggestion, I'll look into
that.
"Danijel Novak" <danijel.novak@.snt.si> wrote in message
news:hLuDd.8040$F6.1370782@.news.siol.net...[vbcol=seagreen]
> Hi,
> could you please write a configuration of the server (OS, etc.).
> It could be a problem with Named Pipes.
> Danijel
>
> "James" <cppjames@.aol.com> wrote in message
> news:%23RL5cs28EHA.2600@.TK2MSFTNGP09.phx.gbl...
no[vbcol=seagreen]
the
>

[DBMSSOCN]General network error.

We've recently rebuilt our database and we're running an ASP front end.
Everything was working just fine today until about 15 minutes ago when no
one could search the database and when they attempted to do so, they
received the following error:
"[DBMSSOCN]General network error. Check your network settings ..."
I found a MSKB article on this but it didn't seem to be relevant. Any idea
what could be causing this? This is the 2nd time in as many days that the
site has worked for the majority of the day and then all of a sudden
crashed. I believe this has something to do with the way I'm connecting to
the SQL server.
Thanks!
JamesHi,
could you please write a configuration of the server (OS, etc.).
It could be a problem with Named Pipes.
Danijel
"James" <cppjames@.aol.com> wrote in message
news:%23RL5cs28EHA.2600@.TK2MSFTNGP09.phx.gbl...
> We've recently rebuilt our database and we're running an ASP front end.
> Everything was working just fine today until about 15 minutes ago when no
> one could search the database and when they attempted to do so, they
> received the following error:
> "[DBMSSOCN]General network error. Check your network settings ..."
> I found a MSKB article on this but it didn't seem to be relevant. Any
> idea
> what could be causing this? This is the 2nd time in as many days that the
> site has worked for the majority of the day and then all of a sudden
> crashed. I believe this has something to do with the way I'm connecting
> to
> the SQL server.
> Thanks!
> James
>|||SQL Server 2000, Windows 2003. Thanks for the suggestion, I'll look into
that.
"Danijel Novak" <danijel.novak@.snt.si> wrote in message
news:hLuDd.8040$F6.1370782@.news.siol.net...
> Hi,
> could you please write a configuration of the server (OS, etc.).
> It could be a problem with Named Pipes.
> Danijel
>
> "James" <cppjames@.aol.com> wrote in message
> news:%23RL5cs28EHA.2600@.TK2MSFTNGP09.phx.gbl...
no[vbcol=seagreen]
the[vbcol=seagreen]
>

[DBMSSOCN]General network error.

We've recently rebuilt our database and we're running an ASP front end.
Everything was working just fine today until about 15 minutes ago when no
one could search the database and when they attempted to do so, they
received the following error:
"[DBMSSOCN]General network error. Check your network settings ..."
I found a MSKB article on this but it didn't seem to be relevant. Any idea
what could be causing this? This is the 2nd time in as many days that the
site has worked for the majority of the day and then all of a sudden
crashed. I believe this has something to do with the way I'm connecting to
the SQL server.
Thanks!
JamesHi,
could you please write a configuration of the server (OS, etc.).
It could be a problem with Named Pipes.
Danijel
"James" <cppjames@.aol.com> wrote in message
news:%23RL5cs28EHA.2600@.TK2MSFTNGP09.phx.gbl...
> We've recently rebuilt our database and we're running an ASP front end.
> Everything was working just fine today until about 15 minutes ago when no
> one could search the database and when they attempted to do so, they
> received the following error:
> "[DBMSSOCN]General network error. Check your network settings ..."
> I found a MSKB article on this but it didn't seem to be relevant. Any
> idea
> what could be causing this? This is the 2nd time in as many days that the
> site has worked for the majority of the day and then all of a sudden
> crashed. I believe this has something to do with the way I'm connecting
> to
> the SQL server.
> Thanks!
> James
>|||SQL Server 2000, Windows 2003. Thanks for the suggestion, I'll look into
that.
"Danijel Novak" <danijel.novak@.snt.si> wrote in message
news:hLuDd.8040$F6.1370782@.news.siol.net...
> Hi,
> could you please write a configuration of the server (OS, etc.).
> It could be a problem with Named Pipes.
> Danijel
>
> "James" <cppjames@.aol.com> wrote in message
> news:%23RL5cs28EHA.2600@.TK2MSFTNGP09.phx.gbl...
> > We've recently rebuilt our database and we're running an ASP front end.
> > Everything was working just fine today until about 15 minutes ago when
no
> > one could search the database and when they attempted to do so, they
> > received the following error:
> >
> > "[DBMSSOCN]General network error. Check your network settings ..."
> >
> > I found a MSKB article on this but it didn't seem to be relevant. Any
> > idea
> > what could be causing this? This is the 2nd time in as many days that
the
> > site has worked for the majority of the day and then all of a sudden
> > crashed. I believe this has something to do with the way I'm connecting
> > to
> > the SQL server.
> >
> > Thanks!
> > James
> >
> >
>

[CR6] Can I use "SELECT FROM WHERE"?

Hi, sorry for my english :-\

I'm working on Crystal Report 6.0
I have 2 tables that are not in join, but I need a field with a "where" condition.
Example:
TableA:
fldDescription

TableB:
fldCode
fldDesc

I have a formula field which should show TableB.fldDesc, using a code in TableA.fldDescription
I extract 2 char in TableA.fldDescription:
strMyField = Trim (Mid ({TableA.fldDescription},2 , 2));

Now I must show TableB.fldDesc where TableB.fldCode = strMyField.
How can I do this? I have no join between this tables, I tried to put in the formula field "Select TableB.fldDesc where TableB.fldCode = strMyField" but it doesn't work.

Could you help me, please?How are TableA and TableB related? Do you even need any data from TableA?

"Select TableB.fldDesc where TableB.fldCode = strMyField"

If this were VB, you would have to do it like this:

"Select TableB.fldDesc where TableB.fldCode = '" & strMyField & "'"

In other words, you would have to concatenate the variable into the string you're using for your select statement. Also, you would need to put the string in single quotes (as shown in Red) to tell your database that it's a string. (These examples are derived from VB 6 and SQL Server 7, so you may need to adjust them accordingly).

I don't use Crystal Reports for direct database access. I let VB do all the data gathering and I just pass the data itself to Crystal for displaying. I'm not sure what the correct syntax is for Database SQL Statement within Crystal Reports, but I hope that my examples might give you a starting point to figure out your problem.

Good Luck!

[ask] trigger in sqlserver not working, HELPP!

i have this trigger in my database :

ALTER TRIGGER dbo.AddVoucher
ON dbo.User_AddVoucher
AFTER INSERT
AS
SET NOCOUNT ON;

DECLARE @.UserId int,
@.Add_id int,
@.voucher_id char,
@.Kredit money,
@.date smalldatetime,
@.last_balance money,
@.voucher_status char

SELECT @.UserId = UserId,
@.voucher_id = Voucher_ID,
@.Add_id = Add_id,
@.date = Deposit_Date
FROM Inserted

SELECT @.Kredit= Voucher_Value,
@.voucher_status = Voucher_Status
FROM Voucher
WHERE Voucher_ID = @.voucher_id

INSERT INTO User_Balance(AddVoucher_ID, UserId, Update_Type, Update_Date)
VALUES (@.Add_id,@.UserId, 'Kredit',@.date)

select @.last_balance = Balance
from User_Balance
WHERE UserId = @.UserId and Balance = (select TOP 1 Balance User_Balance where UserId = @.UserId order by Update_Id DESC)

if (@.voucher_status = 'active')

-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.

-- Insert statements for trigger here
BEGIN
update User_Balance
set Balance = @.last_balance + @.Kredit
where AddVoucher_ID = @.Add_id

update Voucher
set Sold_Date = @.date
where Voucher_ID = @.voucher_id

END

ELSE
BEGIN
raiserror ('Voucher is not valid',0,1)
rollback transaction
END
go

the problem is the update function is not working and the if statement always put to 'FALSE'

do you think anything wrong with the code

Thats perhaps because of the way you have declared the @.voucher_status parameter. char by default is same as char(1). So your @.voucher_status will only have an "a" if the status was "active". So change your datatype to @.varchar(10).

|||

oh my god...i didn't notice it...just a little mistake there, thanks bro for your help....

it runs smoothly now...

Monday, February 13, 2012

[?]Restore and Backup problem

I've a program with VB6 working with SQLServer 2000.
I have a Central Station with the program runnin with full prvileges and
that can perform all the actions on the DB.
There are also some clients that cannot be connected via LAN or internet
that need to use the same DB.
The way I solved this with Aces was to copy the Access file from the Central
Station ot the disconnected clients.
Then to update the central Staton I used to save the recordset of new data
entered from there onto files and then copy them into the Central Station.
Now I'm upgrading the program to run with SQLServer.
I can do everything but the Backup and restore of the DB.
Actually I perform the DB Backup to file with the command line

BACKUP DATABASE myDB TO DISK = 'TempFileName.bak'

This way I can save the file on a USB key or send it via email

Then I restore it on the disconnected clients using the command line

RESTORE DATABASE myDB FROM DISK ='TempFileName.bak' WITH REPLACE

Everything looks fine and seems to work, but on my testing machine I'm
having this strange behavior:

I create new datas into the DataBase, then I execute the backup and quit the
application.
I open EM and delete the just entered datas
I open the application simulating the disconnected clinet (just a string
option, the program is the same)
I execute the RESTORE
I expect hte cancelled datas to be back online, but...... the cancelled
datas is not restored.
I then open EM and execute a backup from the file I created with Backup and
..... the data goes in.
Why?
Is the problem raised only becouse the SQLServer is the same in both cases?

What I need is just to copy one DB and inserting it into a different Server.
Any idea why this is appening?
Any idea on how to do this operation?

I tryed already the RECOVERY, NORECOVERY and quite everything, but ......

Thanks in advance for your helpPerhaps you are inadvertently appending to the backup file instead of
overwriting. Try

BACKUP DATABASE myDB TO DISK = 'TempFileName.bak' WITH INIT

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Spieg" <spiegator@.tiscali.it> wrote in message
news:WgQUc.120173$OR2.6141961@.news3.tin.it...
> I've a program with VB6 working with SQLServer 2000.
> I have a Central Station with the program runnin with full prvileges and
> that can perform all the actions on the DB.
> There are also some clients that cannot be connected via LAN or internet
> that need to use the same DB.
> The way I solved this with Aces was to copy the Access file from the
Central
> Station ot the disconnected clients.
> Then to update the central Staton I used to save the recordset of new data
> entered from there onto files and then copy them into the Central Station.
> Now I'm upgrading the program to run with SQLServer.
> I can do everything but the Backup and restore of the DB.
> Actually I perform the DB Backup to file with the command line
> BACKUP DATABASE myDB TO DISK = 'TempFileName.bak'
> This way I can save the file on a USB key or send it via email
> Then I restore it on the disconnected clients using the command line
> RESTORE DATABASE myDB FROM DISK ='TempFileName.bak' WITH REPLACE
> Everything looks fine and seems to work, but on my testing machine I'm
> having this strange behavior:
> I create new datas into the DataBase, then I execute the backup and quit
the
> application.
> I open EM and delete the just entered datas
> I open the application simulating the disconnected clinet (just a string
> option, the program is the same)
> I execute the RESTORE
> I expect hte cancelled datas to be back online, but...... the cancelled
> datas is not restored.
> I then open EM and execute a backup from the file I created with Backup
and
> .... the data goes in.
> Why?
> Is the problem raised only becouse the SQLServer is the same in both
cases?
> What I need is just to copy one DB and inserting it into a different
Server.
> Any idea why this is appening?
> Any idea on how to do this operation?
> I tryed already the RECOVERY, NORECOVERY and quite everything, but ......
> Thanks in advance for your help|||Right, the WITH INIT Worked, damn I read it, but ...
Thanks

"Dan Guzman" <danguzman@.nospam-earthlink.net> ha scritto nel messaggio
news:c3UUc.6485$3O3.6087@.newsread2.news.pas.earthl ink.net...
> Perhaps you are inadvertently appending to the backup file instead of
> overwriting. Try
> BACKUP DATABASE myDB TO DISK = 'TempFileName.bak' WITH INIT
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP

[:#] problems viewing the custom sql statement in the gridview control

Hi,

I really need some help trying to figure out why my gridview is not working when I create a custom sql statement. It "executes" the query, but gives me an error message when I "test the query". Here is the error message:"There was an error executing the query. Please check the syntax of the command and if present, the types and values of the parameters and ensure they are correct. Syntax error: Expecting '.', identifier or quoted identifier."

Here is my sql statement:

SELECT TBLPROJECTS.NAME, TBLPROJECTTYPES.NAME AS PROJECTTYPE, TBLPROJECTS.DESCRIPTION, TBLUSERS_1.LOGIN AS OWNERNAME,
TBLUSERS.LOGIN AS MANAGERNAME, TBLPROJECTS.START_DATE, TBLPROJECTS.END_DATE, TBLAOI.NAME AS AREAOFINTEREST,
TBLPROJECTS.MANPOWER, TBLUNITS.NAME AS MANPOWERUNIT
FROM TBLPROJECTS INNER JOIN
TBLAOI ON TBLPROJECTS.AOI_ID = TBLAOI.ID INNER JOIN
TBLPROJECTTYPES ON TBLPROJECTS.PROJECTTYPE_ID = TBLPROJECTTYPES.ID INNER JOIN
TBLUNITS ON TBLPROJECTS.MANPOWERUNITS_ID = TBLUNITS.ID INNER JOIN
TBLUSERS ON TBLPROJECTS.MANAGER_ID = TBLUSERS.ID INNER JOIN
TBLUSERS TBLUSERS_1 ON TBLPROJECTS.OWNER_ID = TBLUSERS_1.ID

I have tested it on a new project and still it does not work, I cannot find any problem, please help!!!!!!!!!!!!!!!!!!!!!!!!

Does the query compile and return results by itself if you execute it in query analyzer?

|||

Yes, it compiles in the "Execute Query" in the "Query Builder", but when I click next, and it is supposed to Test the query, it doesnt work. Then it gives me an error when I try to ctrl F5,

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

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.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

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.


Stack Trace:

[HttpException (0x80004005): DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +198 System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2775 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59 System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +12 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +101 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +25 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.GridView.DataBind() +5 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +67 System.Web.UI.Control.EnsureChildControls() +97 System.Web.UI.Control.PreRenderRecursiveInternal() +50 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5731


I hope this helps? Thanks

|||

Yes, it compiles in the "Execute Query" in the "Query Builder", but when I click next, and it is supposed to Test the query, it doesnt work. Then it gives me an error when I try to ctrl F5,

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

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.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

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.


Stack Trace:

[HttpException (0x80004005): DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +198 System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2775 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59 System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +12 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +101 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +25 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.GridView.DataBind() +5 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +67 System.Web.UI.Control.EnsureChildControls() +97 System.Web.UI.Control.PreRenderRecursiveInternal() +50 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5731


I hope this helps? Thanks

|||

Yes, it compiles in the "Execute Query" in the "Query Builder", but when I click next, and it is supposed to Test the query, it doesnt work. Then it gives me an error when I try to ctrl F5,

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

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.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

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.


Stack Trace:

[HttpException (0x80004005): DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +198 System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2775 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59 System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +12 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +101 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +25 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.GridView.DataBind() +5 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +67 System.Web.UI.Control.EnsureChildControls() +97 System.Web.UI.Control.PreRenderRecursiveInternal() +50 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5731


I hope this helps? Thanks

|||Hi dotnetjunkie17,

Yes, it compiles in the "Execute Query" in the "Query Builder", but when I click next, and it is supposed to Test the query, it does not work


Since your sql query string even doesn't pass the "Query Builder" , there should be something wrong with your sql query string itself.


I've checked your query string, and find some errors. You cannot use INNER JOIN that way, to correct your errors, following the above code:

SELECT TBLPROJECTS.NAME,
TBLPROJECTTYPES.NAME AS PROJECTTYPE,
TBLPROJECTS.DESCRIPTION,
TBLUSERS_1.LOGIN AS OWNERNAME,
TBLUSERS.LOGIN AS MANAGERNAME,
TBLPROJECTS.START_DATE,
TBLPROJECTS.END_DATE,
TBLAOI.NAME AS AREAOFINTEREST,
TBLPROJECTS.MANPOWER,
TBLUNITS.NAME AS MANPOWERUNIT
FROM
TBLPROJECTS

INNER JOIN
TBLAOI ON TBLPROJECTS.AOI_ID = TBLAOI.ID
INNER JOIN
TBLPROJECTTYPES ON TBLPROJECTS.PROJECTTYPE_ID = TBLPROJECTTYPES.ID
INNER JOIN
TBLUNITS ON TBLPROJECTS.MANPOWERUNITS_ID = TBLUNITS.ID
INNER JOIN
TBLUSERS ON TBLPROJECTS.MANAGER_ID = TBLUSERS.ID
INNER JOIN
TBLUSERS TBLUSERS_1 ON TBLPROJECTS.OWNER_ID = TBLUSERS_1.ID

Saturday, February 11, 2012

@update_mode for Bidirectional Transactional Replication

Hi
I'm in the process of working out how we are going to set up
replication for a client. Quite a daunting task.
I'm think we are going to use Bidirectional Transactional Replication,
as described here:
http://support.microsoft.com/default.aspx?scid=820675
If you look at the sample you will see that they use @.update_mode =
N'sync tran' when creating the subscription. Is this necessary? I set
it up using @.update_mode = N'read only', which seemed to work fine, but
I am worried that I might be missing something.
Any comments welcome...
Thanks
Gary
that's a doc bug - it should read readonly.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Gary van der Merwe" <garyvdm@.gmail.com> wrote in message
news:1130327855.663530.282590@.o13g2000cwo.googlegr oups.com...
> Hi
> I'm in the process of working out how we are going to set up
> replication for a client. Quite a daunting task.
> I'm think we are going to use Bidirectional Transactional Replication,
> as described here:
> http://support.microsoft.com/default.aspx?scid=820675
> If you look at the sample you will see that they use @.update_mode =
> N'sync tran' when creating the subscription. Is this necessary? I set
> it up using @.update_mode = N'read only', which seemed to work fine, but
> I am worried that I might be missing something.
> Any comments welcome...
> Thanks
> Gary
>

@@identity not working using SQL Express 2005 Sept CTP

I have just inherited some code from another company which uses SQL Server.
The logic is dependent on @.@.IDENTITY to retrieve the record just inserted -
so that more info can be added to the record. kind of a silly implementation
- but it uses a bunch of generic code to insert a new row and generate a
GUID, etc.. and it would be significant work to rewrite the entire
application.
The problem is the even though the table has an id column that is defined
with IDENTITY - and through queries I can easily see that each row added has
the proper values for the id column - @.@.IDENTITY inside the .asp vb scripting
app is returning NULL... I am using SQL Server Express 2005 Sept CTP set up
using a system DSN with the SQL Native Client (2005) driver.
here is the code:
Function NewRow(con,tab,col,val)
set nrconn = Server.CreateObject("ADODB.Connection")
nrconn.open SiteConnectionString
cmd = "INSERT INTO "&tab&" ("&col&") VALUES ("&val&") "
Set rs = nrconn.Execute(cmd)
cmd = "select @.@.IDENTITY as 'newid' from "&tab
Set rs = nrconn.Execute(cmd)
set NewRow = rs
End Function
After returning the code uses NewRow("newid") to fetch the record and update
it. of course, it returns NULL and no record is retrieved... Any help
would be much appreciated.
-Steve-o
Hi
You are submitting it as 2 batches, so it is not available to the 2nd one.
Any reason why you are not using stored procedures to do this? Dynamic SQL
is asking for security problems.
SCOPE_IDENTITY is the better way to retrieve is as a trigger will change the
@.@.identity's value if it does another insert.
cmd = "INSERT INTO "&tab&" ("&col&") VALUES ("&val&") "select
SCOPE_IDENTITY as 'newid' from "&tab "
Set rs = nrconn.Execute(cmd)
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"steve-o" <steveo@.discussions.microsoft.com> wrote in message
news:FE2815A4-B7CC-4D44-B14C-D4CDCD4A198C@.microsoft.com...
>I have just inherited some code from another company which uses SQL Server.
> The logic is dependent on @.@.IDENTITY to retrieve the record just
> inserted -
> so that more info can be added to the record. kind of a silly
> implementation
> - but it uses a bunch of generic code to insert a new row and generate a
> GUID, etc.. and it would be significant work to rewrite the entire
> application.
> The problem is the even though the table has an id column that is defined
> with IDENTITY - and through queries I can easily see that each row added
> has
> the proper values for the id column - @.@.IDENTITY inside the .asp vb
> scripting
> app is returning NULL... I am using SQL Server Express 2005 Sept CTP set
> up
> using a system DSN with the SQL Native Client (2005) driver.
> here is the code:
> Function NewRow(con,tab,col,val)
> set nrconn = Server.CreateObject("ADODB.Connection")
> nrconn.open SiteConnectionString
> cmd = "INSERT INTO "&tab&" ("&col&") VALUES ("&val&") "
> Set rs = nrconn.Execute(cmd)
> cmd = "select @.@.IDENTITY as 'newid' from "&tab
> Set rs = nrconn.Execute(cmd)
> set NewRow = rs
> End Function
> After returning the code uses NewRow("newid") to fetch the record and
> update
> it. of course, it returns NULL and no record is retrieved... Any help
> would be much appreciated.
> --
> -Steve-o
|||Hi
Strange ... the code works on older SQL server version. Nonetheless I
changed as you suggested and same result. I did a little more digging and
the execute line is return rs as type of 'Fields' instead of RecordSet AND
the Count of the Fields is 0... i.e. the execute is returning NOTHING ...
help !
-Steve-o
"Mike Epprecht (SQL MVP)" wrote:

> Hi
> You are submitting it as 2 batches, so it is not available to the 2nd one.
> Any reason why you are not using stored procedures to do this? Dynamic SQL
> is asking for security problems.
> SCOPE_IDENTITY is the better way to retrieve is as a trigger will change the
> @.@.identity's value if it does another insert.
> cmd = "INSERT INTO "&tab&" ("&col&") VALUES ("&val&") "select
> SCOPE_IDENTITY as 'newid' from "&tab "
> Set rs = nrconn.Execute(cmd)
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "steve-o" <steveo@.discussions.microsoft.com> wrote in message
> news:FE2815A4-B7CC-4D44-B14C-D4CDCD4A198C@.microsoft.com...
>
>
|||solved the "Fields" problem - I had erroneously removed the "set" fro the rs
= stmt (WHOOPS !). So now the type is returned as Recordset, however,
rs.Fields.Count is 0 ... so still nothing is being returned...
-Steve-o
"steve-o" wrote:
[vbcol=seagreen]
> Hi
> Strange ... the code works on older SQL server version. Nonetheless I
> changed as you suggested and same result. I did a little more digging and
> the execute line is return rs as type of 'Fields' instead of RecordSet AND
> the Count of the Fields is 0... i.e. the execute is returning NOTHING ...
> help !
> --
> -Steve-o
>
> "Mike Epprecht (SQL MVP)" wrote:
|||more info ...
If I follow the original sequence of insert followed by select query I do
get a recordset back with a field count of 1. the name of the item is indeed
'newid' but the value is NULL.
strangely enough when using SQLCMD and doing this sequence of operations by
hand - SQLCMD outputs one line for each record in the table with the newid
field value for each being the "latest" value (i.e. value of 23 if the last
inserted record had and identity value of 23). so it seems like it is
working there, but not in the scripted app...
-Steve-o
"steve-o" wrote:
[vbcol=seagreen]
> solved the "Fields" problem - I had erroneously removed the "set" fro the rs
> = stmt (WHOOPS !). So now the type is returned as Recordset, however,
> rs.Fields.Count is 0 ... so still nothing is being returned...
> --
> -Steve-o
>
> "steve-o" wrote:
|||Try adding SET NOCOUNT ON before the INSERT statement.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"steve-o" <steveo@.discussions.microsoft.com> wrote in message
news:9F100702-8F1B-4A2B-807E-14E72416B956@.microsoft.com...[vbcol=seagreen]
> more info ...
> If I follow the original sequence of insert followed by select query I do
> get a recordset back with a field count of 1. the name of the item is indeed
> 'newid' but the value is NULL.
> strangely enough when using SQLCMD and doing this sequence of operations by
> hand - SQLCMD outputs one line for each record in the table with the newid
> field value for each being the "latest" value (i.e. value of 23 if the last
> inserted record had and identity value of 23). so it seems like it is
> working there, but not in the scripted app...
>
> --
> -Steve-o
>
> "steve-o" wrote:
|||YAY !!! Mike gave me the first half of the solution and Tibor the second
half. Thanks !!!
-Steve-o
"Tibor Karaszi" wrote:

> Try adding SET NOCOUNT ON before the INSERT statement.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "steve-o" <steveo@.discussions.microsoft.com> wrote in message
> news:9F100702-8F1B-4A2B-807E-14E72416B956@.microsoft.com...
>

Thursday, February 9, 2012

@@Rowcount or output parameters error

I have the following stored procedure working with an Access 2000 front end. The output parameters returned to Access are both Null when the record is successfully updated (ie when @.@.Rowcount = 1), but the correct parameters are returned when the update fails. I'm a bit new to using output parameters, but I have them working perfectly with an insert sproc, and they look basically the same. What bonehead error have I made here? The fact that the record is updated indicates to me that the Commit Trans line is being executed, so why aren't the 2 output parameters set?

TIA

EDIT: Solved, sort of. I found that dropping the "@.ResNum +" from "@.ResNum + ' Updated'" resolved the problem (@.ResNum is an input parameter). This implies that the variable lost its value between the SQL statement and the If/Then, since the SQL correctly updates only the appropriate record from the WHERE clause. Is this supposed to happen? I looked in BOL, and if it's addressed there I missed it.

CREATE PROCEDURE [procResUpdate]

Various input parameters here,

@.RetCode as int Output, @.RetResNum as nvarchar(15) Output

AS

Declare @.RowCounter int

Begin Tran

UPDATE tblReservations
SET Various set statements here, LastModified = @.LastModified + 1
WHERE ResNum = @.ResNum AND LastModified = @.LastModified

SELECT @.RowCounter = @.@.ROWCOUNT

If @.RowCounter = 1
Begin
Commit Tran
Select @.RetCode = 1
Select @.RetResNum = @.ResNum + ' Updated'
End
Else
Begin
Rollback Tran
Select @.RetCode = 0
Select @.RetResNum = 'Update Failed'
End
GOPost the complete DDL for the proc (including @.ResNum) and a sample of calling it that produces the problem you describe.

Regards,

hmscott|||Here's the complete sproc (I added back the offending part in red):

CREATE PROCEDURE [procResUpdate]

@.ReqDate as datetime, @.PassName as nvarchar(25), @.DispDate as datetime, @.PassPhone as nvarchar(25),
@.PassQuant as smallint, @.AuthBy as nvarchar(25), @.AcctID as smallint, @.PuLandmark as smallint, @.PuStreet as nvarchar(50),
@.PuCity as smallint, @.PuXStreet as nvarchar(50), @.PuPoint as nvarchar(50), @.DestLandmark as smallint, @.DestStreet as nvarchar(50),
@.DestCity as smallint, @.DestXStreet as nvarchar(50), @.DestPoint as nvarchar(50), @.Operator as smallint, @.Comments as nvarchar(250),
@.DriverReq as nvarchar(25), @.CarType as smallint, @.EstHours as money, @.EstPrice as money, @.CCType as nvarchar(25), @.CCnum as nvarchar(25),
@.CCAuthNum as nvarchar(25), @.CarQuant as tinyint, @.ResNum as int, @.Status as smallint, @.LastModified as tinyint,

@.RetCode as int = Null Output, @.RetResNum as nvarchar(15) = Null Output

AS

Declare @.RowCounter int

Begin Tran

UPDATE tblReservations
SET ReqDateTime = @.ReqDate, PassName = @.PassName, DispDateTime = @.DispDate, PassPhone = @.PassPhone, PassQuant = @.PassQuant, AuthBy = @.AuthBy, AcctID = @.AcctID,
PuLandmarkID = @.PuLandmark, PuStreet = @.PuStreet, PuCityID = @.PuCity, PuXStreet = @.PuXStreet, PuPoint = @.PuPoint, DestLandmarkID = @.DestLandmark, DestStreet = @.DestStreet,
DestCityID = @.DestCity, DestXStreet = @.DestXStreet, DestPoint = @.DestPoint, OperatorID = @.Operator, Comments = @.Comments, DriverReq = @.DriverReq, CarType = @.CarType,
EstHours = @.EstHours, EstPrice = @.EstPrice, CCType = @.CCType, CCNum = @.CCnum, CCAuthNum = @.CCAuthNum, CarQuant = @.CarQuant, Status = @.Status, LastModified = @.LastModified + 1
WHERE ResNum = @.ResNum AND LastModified = @.LastModified

SELECT @.RowCounter = @.@.ROWCOUNT

If @.RowCounter = 1
Begin
Commit Tran
Select @.RetCode = 1
Select @.RetResNum = ' Updated'
End
Else
Begin
Rollback Tran
Select @.RetCode = 0
Select @.RetResNum = @.ResNum + ' Update Failed'
End
GO


and the VBA that calls it. The 2 highlighted lines will be null if the "@.ResNum + " is included. Otherwise, it runs fine.

Public Sub cmdUpdate_Click()
Dim strSQL As String
Dim strField As String
Dim fOK As Integer
Dim intCount As Integer
Dim x As Integer
Dim strMsg As String
Dim cmd As ADODB.Command
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim tdf As DAO.TableDef
Dim dteReqDate As Date
Dim dteDispDate As Date

On Error GoTo ErrorHandler

dteReqDate = Me.txtReqDate & " " & Me.txtReqTime
dteDispDate = DateAdd("n", -Nz(Me.txtMinutesAhead, 0), dteReqDate)

Call EstablishConnection
Set db = CurrentDb()
Set cmd = New ADODB.Command
Set rst = New ADODB.Recordset
Set tdf = db.TableDefs("tblReservations_Local")
rst.ActiveConnection = objConn

With cmd
.ActiveConnection = objConn
.CommandText = "procResUpdate"
.CommandType = adCmdStoredProc

.Parameters.Append .CreateParameter("@.ReqDate", adDBTimeStamp, adParamInput, , dteReqDate)
.Parameters.Append .CreateParameter("@.PassName", adVarChar, adParamInput, 25, Me.txtPassName)
.Parameters.Append .CreateParameter("@.DispDate", adDBTimeStamp, adParamInput, , dteDispDate)
.Parameters.Append .CreateParameter("@.PassPhone", adVarChar, adParamInput, 25, Me.txtPassPhone)
.Parameters.Append .CreateParameter("@.PassQuant", adInteger, adParamInput, , Me.txtPassQuant)
.Parameters.Append .CreateParameter("@.AuthBy", adVarChar, adParamInput, 25, Me.txtAuthBy)
.Parameters.Append .CreateParameter("@.AcctID", adInteger, adParamInput, , Me.cboAcctNum)
.Parameters.Append .CreateParameter("@.PuLandmark", adInteger, adParamInput, , Me.cboLandmark)
.Parameters.Append .CreateParameter("@.PuStreet", adVarChar, adParamInput, 50, Me.txtPuAddress)
.Parameters.Append .CreateParameter("@.PuCity", adInteger, adParamInput, , Me.cboPuCity)
.Parameters.Append .CreateParameter("@.PuXStreet", adVarChar, adParamInput, 50, Me.txtPuXStreet)
.Parameters.Append .CreateParameter("@.PuPoint", adVarChar, adParamInput, 50, Me.txtPuPoint)
.Parameters.Append .CreateParameter("@.DestLandmark", adInteger, adParamInput, , Me.cboDestLandmark)
.Parameters.Append .CreateParameter("@.DestStreet", adVarChar, adParamInput, 50, Me.txtDestAddress)
.Parameters.Append .CreateParameter("@.DestCity", adInteger, adParamInput, , Me.cboDestCity)
.Parameters.Append .CreateParameter("@.DestXStreet", adVarChar, adParamInput, 50, Me.txtDestXStreet)
.Parameters.Append .CreateParameter("@.DestPoint", adVarChar, adParamInput, 50, Me.txtDestPoint)
.Parameters.Append .CreateParameter("@.Operator", adInteger, adParamInput, , Me.txtOperator)
.Parameters.Append .CreateParameter("@.Comments", adVarChar, adParamInput, 250, Me.txtComments)
.Parameters.Append .CreateParameter("@.DriverReq", adVarChar, adParamInput, 25, Me.txtDriverReq)
.Parameters.Append .CreateParameter("@.CarType", adInteger, adParamInput, , Me.cboCarType)
.Parameters.Append .CreateParameter("@.EstHours", adCurrency, adParamInput, , Me.txtEstHours)
.Parameters.Append .CreateParameter("@.EstPrice", adCurrency, adParamInput, , Me.txtEstPrice)
.Parameters.Append .CreateParameter("@.CCType", adVarChar, adParamInput, 25, Me.cboCCType)
.Parameters.Append .CreateParameter("@.CCnum", adVarChar, adParamInput, 25, Me.txtCCNum)
.Parameters.Append .CreateParameter("@.CCAuthNum", adVarChar, adParamInput, 25, Me.txtCCAuthNum)
.Parameters.Append .CreateParameter("@.CarQuant", adInteger, adParamInput, , Me.txtCarQuant)
.Parameters.Append .CreateParameter("@.ResNum", adInteger, adParamInput, , Me.txtResNum)
.Parameters.Append .CreateParameter("@.Status", adInteger, adParamInput, , Me.cboStatus)
.Parameters.Append .CreateParameter("@.LastModified", adInteger, adParamInput, , Me.txtLastModified)

.Parameters.Append .CreateParameter("@.RetCode", adInteger, adParamOutput)
.Parameters.Append .CreateParameter("@.RetResNum", adVarChar, adParamOutput, 15)

.Execute

End With

fOK = cmd.Parameters("@.RetCode")
strMsg = cmd.Parameters("@.RetResNum")|||Update for anyone interested. It seems that there was a type mismatch occurring. @.ResNum is a numeric value (data type int), and apparently in this line that caused a problem:

Select @.RetResNum = @.ResNum + ' Update Failed'

I assumed it would concatenate the two values. If I create a new varchar variable and populate it with the value of @.ResNum (converted to varchar) and use that, everything works fine. What threw me was that not only was that return parameter null, but the other one was too.