Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Thursday, March 22, 2012

Escape Sequences

Is there an escape sequence available for the SQL Analyzer that will not
mung the `'` (apostrophe)
If I add it as a parameter in my code, it works, but I am curious to know
all the same.I'm not sure what you mean by "that will not mung the `'` (apostrophe)", but
if you pass a string which includes a single quote, you need to escape that
single quote with a single quote. I.e., double each single quote before
passing the string to SQL Server.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Wayne M J" <not@.home.nor.bigpuddle.com> wrote in message
news:%23ex1p5wvDHA.2444@.TK2MSFTNGP12.phx.gbl...
> Is there an escape sequence available for the SQL Analyzer that will not
> mung the `'` (apostrophe)
> If I add it as a parameter in my code, it works, but I am curious to know
> all the same.
>|||"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@.cornerstone.se>
wrote in message news:OMO5w8wvDHA.2072@.TK2MSFTNGP10.phx.gbl...
> I'm not sure what you mean by "that will not mung the `'` (apostrophe)",
but
> if you pass a string which includes a single quote, you need to escape
that
> single quote with a single quote. I.e., double each single quote before
> passing the string to SQL Server.
That is exactly what I was looking for.
Thanks.

Wednesday, March 7, 2012

Error--Procedure SP_Insert_NewPipeLine expects parameter @CompanyId, which was not supplie

Can any body help me in solving this problem.

First I use to get Error which reads "Object Must Implement Iconvertible"

After using the overloaded Sp.paramerers.add() function It started giving this problem.

I am giving the sample code.

ConObject =

new SqlConnection(ConString);

ConObject.Open();

string SpString ="dbo.SP_Insert_NewPipeLine";

SqlCommand CmdObject =

new SqlCommand(SpString,ConObject);

CmdObject.CommandType = CommandType.StoredProcedure;

CmdObject.Parameters.Add("@.RequestTypeId",SqlDbType.Int,4,"0");

//CmdObject.Parameters["@.RequestTypeId"].Value= 0;

CmdObject.Parameters.Add("@.OnBehalfOf",SqlDbType.Int,4,"21");

//Onbehalf of Id//CmdObject.Parameters["@.OnBehalfOf"].Value = 21;

CmdObject.Parameters.Add("@.SubmittedBy",SqlDbType.Int,4,ddlSalesRep.SelectedValue.ToString());

//Submitted by Id//CmdObject.Parameters["@.SubmittedBy"].Value = ddlSalesRep.SelectedItem.Value;

CmdObject.Parameters.Add("@.CompanyId",SqlDbType.Int,4,ddlCustomer.SelectedItem.Value.ToString());

//Company_Id//CmdObject.Parameters["@.CompanyId"].Value = ddlCustomer.SelectedItem.Value;

CmdObject.ExecuteScalar();

Execuse me, may be a silly question: are you sure the ddlSalesRep.SelectedValue/ddlCustomer.SelectedItem.Value has value when the command was being executed?

|||

I am sure that all fields have values before submitting the page.

There is no error on data types also.

Finally the error Comes as

"Object can not Implement Iconvertible"

Friday, February 17, 2012

Error: Subreport could not be shown 2

Hi
I have a "master" report that has 10 chart sub reports that don't have any
parameter. I get a "Error: Subreport could not be shown" error if one of
them are snapshot based.
Any ideas?
Regards,
AndresOn Apr 14, 8:12 pm, "Andres" <andresfon...@.hotmail.com> wrote:
> Hi
> I have a "master" report that has 10 chart sub reports that don't have any
> parameter. I get a "Error: Subreport could not be shown" error if one of
> them are snapshot based.
> Any ideas?
> Regards,
> Andres
You might be able to resolve this error by returning a default empty
resultset. Also, make sure that all the dependencies of the subreport
are available (i.e., if you are developing reports in a development
environment and then need to transfer them to the production
environment along w/all dependent stored procedures, tables, etc).
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi Enrique
Which report should return a default empty resultset?
And, what's a default empty resultset?
The main report don't have any resultset. I think sub reports have all they
need. They work fine when I use them directly in default mode (no snapshot)
and in snapshot mode.
Regards,
Andrés
"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:1176659677.215808.157620@.e65g2000hsc.googlegroups.com...
> On Apr 14, 8:12 pm, "Andres" <andresfon...@.hotmail.com> wrote:
>> Hi
>> I have a "master" report that has 10 chart sub reports that don't have
>> any
>> parameter. I get a "Error: Subreport could not be shown" error if one of
>> them are snapshot based.
>> Any ideas?
>> Regards,
>> Andres
>
> You might be able to resolve this error by returning a default empty
> resultset. Also, make sure that all the dependencies of the subreport
> are available (i.e., if you are developing reports in a development
> environment and then need to transfer them to the production
> environment along w/all dependent stored procedures, tables, etc).
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

Wednesday, February 15, 2012

Error: Subreport could not be shown

I have an infuriating problem which I can't seem to overcome with my first
report containing a sub-report. 1 simple parameter a GUID string is passed
from the parent report to the subreport and all I seem to get in return is
the message 'Error: Subreport could not be shown' with no indication as to
what the problem is or might be. If i view the subreport on its own and
manually enter the parameter the sub report displays fine and as expected
but when the parameter is passed via the parent form it won't play ball.
Thanks in advance for any help - u will be doing me a big favour if you can
help me overcome this.
SimonProbably a type-problem. Are you sure you "send" a string and that the
receiving parameter is also a string?
"Simon Dingley" wrote:
> I have an infuriating problem which I can't seem to overcome with my first
> report containing a sub-report. 1 simple parameter a GUID string is passed
> from the parent report to the subreport and all I seem to get in return is
> the message 'Error: Subreport could not be shown' with no indication as to
> what the problem is or might be. If i view the subreport on its own and
> manually enter the parameter the sub report displays fine and as expected
> but when the parameter is passed via the parent form it won't play ball.
> Thanks in advance for any help - u will be doing me a big favour if you can
> help me overcome this.
> Simon
>
>|||Hi and thanks for the reply,
The parameter passed is a 'field' e.g. =Fields!qst_id.Value which is
actually a GUID from the database. As far as I can see there is no way for
me to specify in the sub-report properties what data type the parameter is.
However, in the sub report itself the parameter data type is defined as
being a string ?
Does this shed any light on things ?
Thanks, Simon
"Antoon" <Antoon@.discussions.microsoft.com> wrote in message
news:4CD7BC66-C0E9-4E79-957E-0C8040C1EA4C@.microsoft.com...
> Probably a type-problem. Are you sure you "send" a string and that the
> receiving parameter is also a string?
> "Simon Dingley" wrote:
> > I have an infuriating problem which I can't seem to overcome with my
first
> > report containing a sub-report. 1 simple parameter a GUID string is
passed
> > from the parent report to the subreport and all I seem to get in return
is
> > the message 'Error: Subreport could not be shown' with no indication as
to
> > what the problem is or might be. If i view the subreport on its own and
> > manually enter the parameter the sub report displays fine and as
expected
> > but when the parameter is passed via the parent form it won't play ball.
> >
> > Thanks in advance for any help - u will be doing me a big favour if you
can
> > help me overcome this.
> >
> > Simon
> >
> >
> >|||Try passing Fields!qst_id.Value.ToString() to the subreport
(I do presume the subreport is within a matrix, tabele, list,... and not "on
its own". In the last case you should use an agregate function fe
first(Fields!qst_id.Value).ToString() )
"Simon Dingley" wrote:
> Hi and thanks for the reply,
> The parameter passed is a 'field' e.g. =Fields!qst_id.Value which is
> actually a GUID from the database. As far as I can see there is no way for
> me to specify in the sub-report properties what data type the parameter is.
> However, in the sub report itself the parameter data type is defined as
> being a string ?
> Does this shed any light on things ?
> Thanks, Simon
> "Antoon" <Antoon@.discussions.microsoft.com> wrote in message
> news:4CD7BC66-C0E9-4E79-957E-0C8040C1EA4C@.microsoft.com...
> > Probably a type-problem. Are you sure you "send" a string and that the
> > receiving parameter is also a string?
> >
> > "Simon Dingley" wrote:
> >
> > > I have an infuriating problem which I can't seem to overcome with my
> first
> > > report containing a sub-report. 1 simple parameter a GUID string is
> passed
> > > from the parent report to the subreport and all I seem to get in return
> is
> > > the message 'Error: Subreport could not be shown' with no indication as
> to
> > > what the problem is or might be. If i view the subreport on its own and
> > > manually enter the parameter the sub report displays fine and as
> expected
> > > but when the parameter is passed via the parent form it won't play ball.
> > >
> > > Thanks in advance for any help - u will be doing me a big favour if you
> can
> > > help me overcome this.
> > >
> > > Simon
> > >
> > >
> > >
>
>|||Antoon - you're a star. That worked a treat.
Many thanks for your help.
Simon
"Antoon" <Antoon@.discussions.microsoft.com> wrote in message
news:283D9BE2-1B26-4066-A3AE-A477868DEB96@.microsoft.com...
> Try passing Fields!qst_id.Value.ToString() to the subreport
> (I do presume the subreport is within a matrix, tabele, list,... and not
"on
> its own". In the last case you should use an agregate function fe
> first(Fields!qst_id.Value).ToString() )
>|||One more quick question if I can. This works great for me when developing
and previewing in Visual Studio .Net but when I deploy the report to the
reporting server I get the subreport could be shown error again ? Do you
know why this is ?
Simon
"Antoon" <Antoon@.discussions.microsoft.com> wrote in message
news:283D9BE2-1B26-4066-A3AE-A477868DEB96@.microsoft.com...
> Try passing Fields!qst_id.Value.ToString() to the subreport
> (I do presume the subreport is within a matrix, tabele, list,... and not
"on
> its own". In the last case you should use an agregate function fe
> first(Fields!qst_id.Value).ToString() )|||Not too worry - after viewing the subreport as a standalone report i
discovered there was a problem connecting through the shared datasource.
Thanks again.
Simon
>One more quick question if I can. This works great for me when developing
>and previewing in Visual Studio .Net but when I deploy the report to the
>reporting server I get the subreport could be shown error again ? Do you
>know why this is ?
>Simon

Error: SetParameterInfo has not been called

I get error message "Provider cannot derive parameter information
and SetParameterInfo has not been called."

When I try to click on the Parameters button in the Transform Data Task Properties. I wanted to create variables to use in the where clause.

any idea how to fix this error?

novice userWhat isthe version of ADO?