Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Wednesday, March 28, 2012

How to show the ##th record.

Hi,
When I qury data form a View, the system say that :
The are smallint overload in RECORD=RECORD=4891467
How can I get the 4891467th record?Hi
Smallint will hold values between -32,768 and 32,767. It is not clear where
your conversion to smallint is occurring as you have not posted DDL, but you
could use CAST to force it to be converted to int or bigint.
John
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:e4DoKsfYGHA.4884@.TK2MSFTNGP02.phx.gbl...
> Hi,
> When I qury data form a View, the system say that :
> The are smallint overload in RECORD=RECORD=4891467
> How can I get the 4891467th record?
>

How to show the ##th record.

Hi,
When I qury data form a View, the system say that :
The are smallint overload in RECORD=RECORD=4891467
How can I get the 4891467th record?Hi
Smallint will hold values between -32,768 and 32,767. It is not clear where
your conversion to smallint is occurring as you have not posted DDL, but you
could use CAST to force it to be converted to int or bigint.
John
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:e4DoKsfYGHA.4884@.TK2MSFTNGP02.phx.gbl...
> Hi,
> When I qury data form a View, the system say that :
> The are smallint overload in RECORD=RECORD=4891467
> How can I get the 4891467th record?
>

Monday, March 26, 2012

how to show and edit parameters in a windows form

Is there somebody who has used a windows form and a suitable control (Like
Datagrid) to extract parameters of an specific report and let user edit
them?
I 've done the exctracting the parameters ,,but I don't know how to extract
each parameter values(which are based on the different queries) and show it
to the user.
Thanks for your help.
ALISee the Report Wizard demo code in the AwReporterWin WinForm app that
accompanies my book source code.
http://www.manning-sandbox.com/thread.jspa?threadID=10393&tstart=45
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"ALI-R" <newbie@.microsoft.com> wrote in message
news:eqEm5q1yEHA.2624@.TK2MSFTNGP11.phx.gbl...
> Is there somebody who has used a windows form and a suitable control (Like
> Datagrid) to extract parameters of an specific report and let user edit
> them?
> I 've done the exctracting the parameters ,,but I don't know how to
extract
> each parameter values(which are based on the different queries) and show
it
> to the user.
> Thanks for your help.
> ALI
>|||Thank you very much indeed,,I was actually doing the same thing ,but it
helped a lot.
"Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com> wrote in message
news:%23rF5hT4yEHA.2788@.TK2MSFTNGP15.phx.gbl...
> See the Report Wizard demo code in the AwReporterWin WinForm app that
> accompanies my book source code.
> http://www.manning-sandbox.com/thread.jspa?threadID=10393&tstart=45
> --
> Hope this helps.
> ---
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ---
> "ALI-R" <newbie@.microsoft.com> wrote in message
> news:eqEm5q1yEHA.2624@.TK2MSFTNGP11.phx.gbl...
> > Is there somebody who has used a windows form and a suitable control
(Like
> > Datagrid) to extract parameters of an specific report and let user edit
> > them?
> >
> > I 've done the exctracting the parameters ,,but I don't know how to
> extract
> > each parameter values(which are based on the different queries) and show
> it
> > to the user.
> >
> > Thanks for your help.
> > ALI
> >
> >
>

Friday, March 9, 2012

how to set null values to the database ?

I have some textboxes that could be blank when the form is submitted. If so, I want those fields in SQL database table to be set NULL when the insert is executed. I also need to convert the values in these textbexes to either INT or String if there are values there. I tried the following.

--Code

int RowNumber;

if (((TextBox)(e.Item.FindControl("RowNumber"))).Text != "" )
{
RowNumber = int.Parse(((TextBox)(e.Item.FindControl("RowNumber"))).Text);
}
else
{
RowNumber = DBNULL.value;
}

--Code

I got the error:

Cannot implicitly convert type "System.DBNull" to "int".

I want to pass RowNumber later to set NULL on the table. I know the data type is not correct, but how I get around with it ? and Is this the only problem ?

Thanks you very dmuchYou'll have to wait until you pass the value into the parameter itself to perform the test; once there, you can pass the parameter the value DBNull.Value.|||Thank you very much.. Can you show me how to do it.. please ?|||Assuming you are using sprocs, and passing in parameters to these sprocs:

'With your command object
myCmd.Parameters.Add("@.myParam",SQLDBType.INT).Value = IIf(myTextBox.Text <> "", myTextBox.Text, DBNull.Value)

Obviously, this is over-simplified (and in VB, no less), but I hope it gives you a general idea...|||I understand that I can do this when I put up the Sqlparameter object. But the problem is that I need to pass all the variables from my code-behind to a component which handles all the Sqlparameter things. It would not all me to pass the variables if they are not assigned certain values. so I need to assign NULL to some of them if they have no values. But I cannot do that .. any help ?|||The way I handle this is to pass a non-value to the component; for example, Integer.MinValue. The test for MinValue inside of your sub, and replace it with DBNull.Value.|||Thank you very much, I will try that...