Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Wednesday, March 28, 2012

How to insert a zero length string into a field using SqlDataSource?

I have a few columns in table with default value defined as zero length string (''). I want to insert record from DetailsView which uses SqlDataSource as DataSource. In the ItemInserting event, if the data is not valid, I want to use zero length string for the column. But I always get Null instead of zero length string. The code in ItemInserting event looks like this:

If objddl.SelectedIndex > 0 Then
e.Values("myFld") = objddl.SelectedItem.Value
Else
e.Values("myFld") = ""
End If

The line: e.Values("myFld") = "" put Null in the column.

How can I set a column as zero length string using the SqlDataSource?

Any help is appreciated.

Thanks.

Try:

e.Values("myFld") =string.Empty

|||Check the advanced properties of the parameter in your upate statement. You probably have the property (Sorry, the exact name eludes me) "ChangeEmptyStringToNull" set to true (true is the default).|||Thank you very much. "ConvertEmptyStringToNull" worked perfectly.

Friday, March 23, 2012

How to increase the default row size in sql server 2000 only

Hi, Guys.
I am in bit trouble.I am importing the table from mysql to sql server which has having nearly 65000 records.
I starts the import of table by import/export utility.But when the records reaches 65000, the error message came.."THIS TABLE HAVING ROW SIZE 8190 WHICH IS EXCCEDING THE DEFAULT SIZE OF 8060".
So please let me know how to over come this problem..

I CAN'T UPGRADE SQL SERVER SO GIVE SOLUTION FOR SQL SERVER 2000 ONLY...

Thanks in Advance to all of you.

pchadha20For my knowledge it isn't possible to change that limit. You should split your table or in some cases use Ntext-type but that would generate a lot of other troubles.

how to increase maximum rowsize in sql server 2000

Is there any ways to increase the default maximum row size
of 8060 in SQL server 2000?
Thanks in advance
kiranNo you cannot.
You can however split your table into multiple tables and maintain
relationships between them.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"kiran kumar joseph" <kiran_joseph82@.yahoo.com> wrote in message
news:00f201c3aff4$742ea1c0$a001280a@.phx.gbl...
> Is there any ways to increase the default maximum row size
> of 8060 in SQL server 2000?
> Thanks in advance
> kiran|||Another option is to use text columns instead of varchars.
--
Andrew J. Kelly
SQL Server MVP
"SriSamp" <ssampath@.sct.co.in> wrote in message
news:uLq%23gd$rDHA.1996@.TK2MSFTNGP09.phx.gbl...
> No you cannot.
> You can however split your table into multiple tables and maintain
> relationships between them.
> --
> HTH,
> SriSamp
> Please reply to the whole group only!
> http://www32.brinkster.com/srisamp
> "kiran kumar joseph" <kiran_joseph82@.yahoo.com> wrote in message
> news:00f201c3aff4$742ea1c0$a001280a@.phx.gbl...
> > Is there any ways to increase the default maximum row size
> > of 8060 in SQL server 2000?
> >
> > Thanks in advance
> > kiran
>

Sunday, February 19, 2012

How to hold report generation till "View Report" is clicked ?

I have a report, for which I have defined queried multi-valued default values for all the parameters.Now when I click on the report, it picks the default values automatically without clicking the “View Report” button.

Can we control this feature,so that unless user clicks on the “View Report” button, the report is not generated ?

The only way to get this behavior is to put a parameter on the report which is not nullable and has no default value. The viewer control will require the user select a value for this parameter before executing the report.

Another option is to not use the built-in UI, and instead use the viewer control in your application.