Replace column text of gridView in vb6 - grid

I want to replace all the columns in a gridview having a text value of "," with blank. How do I do that?
I try to just to give string value to the particular index column:
GridviewName.Columns.Item(3).text=""
But that generates this error:
Error with dataType mismatch while updating field

Related

Data truncation warning without width change

I have a BINARY(2) DEFAULT NULL column in a MariaDB InnoDB table to store country code, but I would like to remove nullability (the value is always set), so I am trying to run the following query:
ALTER TABLE `table_name` MODIFY COLUMN `country_code` BINARY(2) NOT NULL;
However, I have the following error:
Error 1265: Data truncated for column 'country_code' at row 357
There are no rows with values that exceed 2 characters, checked with
SELECT MAX(LENGTH(`country_code`)) FROM `table_name`
Which returns 2.
In that case, what is the possible cause of data truncation, and how to workaround?

Make drop down list default value selected in Excel using spreadsheet gear + VB.Net

I am using below code to create a dropdownlist in Excel with "Yes,No" vallues displayed, but initially it is showing blank
worksheet.Range("I4:I5").Validation.Add(ValidationType.List, ValidationAlertStyle.Information, ValidationOperator.Default, "Yes,No", Nothing)
Initially I want default to set to "No", and the excel cell should be appear with arrow initially- which is not happening
Please help me out, how to do this using spreadsheet gear in VB.Net
THanks
Ramesh
Adding validation to a cell does not automatically populate that cell with a given value, nor does it select the cell (which would make the "arrow" appear, which I think is a reference to the dropdown handle?).
To make these additional things happen, you'll need to explicitly set the cell value via the IRange.Value property and select the desired cell via the IRange.Select() method. Example:
' Get reference to range affected.
Dim range = worksheet.Range("I4:I5")
' Apply validation.
range.Validation.Add(ValidationType.List, ValidationAlertStyle.Information,
ValidationOperator.Default, "Yes,No", Nothing)
' Set initial values of cells to "No".
range.Value = "No"
' Select the first cell in the affected range, I4. Calling select
' directly on "range" would select both I4 and I5.
range(0, 0).Select()

In rdlc split(winform) get last index value of array

In rdlc split(winform) how to get last index value of an array. For example.
=Split(First(Fields!ID.Value),",")(2).
In this, How to take the value 2 as the last index value of the splitted array?
i got the solution, Actually , ,my problem was to get 'ghj' from 'xxxxx F/O ghj'. i accomplished , it by first replacing 'F/O' with comma and then spliting based on comma
SPLIT(Replace(Fields!Name.Value,"F/O",","),",")(1)

Adding text values in container in x++

I have a AttributeTextValue field that stores value for the attributes, The values are in following format , 001,002,003 and so on , and one single attribute can contain multiple values seperated by comma such as
AttributeValue = 001,002,003
and to split each of the text I have used str2con and this stores each value seperated by comma in a container , but issue I am facing is that str2con convert the text value to str and stores strings in container as follows : 1,2,3 but I want it to be same as 001,002 and 003 . How to accomplish this can any one help me out ?
Use str2con(value, ',', false) with parameter _convertNumericToInt64 as false.
With this parameter container elements won't be converted to integer.

Update float data type field with blank spaces in sql

A blank space will be treated as 0 if using float:
for eg:
declare #f float
set #f = ''
print #f
I tried using blank spaces in the columns using update statement, the output will be 0.
But i want to save blank space and retrieve blackspace for field value.
How to possible this.
I am using to update table value from xml file,i am getting balnk value from xml file,but i save this,it will be saved like zero,but i wnat to save this as blank
I need to allow blank space for an decimal parameter how can we do that ?
In order to store a blank like you require in a float column, you need to make it nullable and save null value into this column.
Empty string ('') can only be saved into varchar, text and similar text columns.

Resources