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

Monday, March 26, 2012

multi line rows

Using Visual basic 2005

I have a form and set up my datasource, bindings etc.

All works well, adding, updating, and deleting via form to sqlexpress except.....

I have 2 columns set up in sqlserver that get data from muliline textboxes on my form.

Column 1 "Material" is nvarchar(50)

Column 2 "Quantity" is int

The first multine textbox "Material" works fine, eather updating in the textbox or in the Datagridview cell.

the second multiline textbox "Quantity" works when I just put in a number in the first line of the multiline textbox, when I put in the 2nd number on the second line, nothing gets updated.

I I do that in the datagridview cell (Shift-Enter), I get an error.

"System string was not in correct format".

I tried integer.parse, but that dosn't work. I'm assuming it has something to do with the next line ascii code or something like that.

Can anyone out there help with this

It sounds like the problem is that you are trying to treat a multi-line textbox as a collection of values for when updating to the database... instead of the single long string value.

When saving your results back to the database instead of dealing with the textbox’s Text property, try iterating through each of the lines within its Lines property to pull out each individual value, convert it to a number and then deal with it as needed.

|||

Hi nglow,

Did Brendan's answer resolve your issue? I believe he's correct that the integer field is not going to accept all the lines from your multi-line text box as this is returning a string. The integer field can only hold a single integer number and you seem to be suggesting that you want to put more than one number in it. That won't work.

You either need to limit the text box to a single number, or walk each line in the text box and put each number into a separate row in the database.

Regards,

Mike Wachal
SQL Express team

Mark the best post as Answered.

Multi Language Form

Hi,

I have a table in an MS SQL 2000 database that represents fields on a form.

CREATE TABLE [dbo].[TagData](
[FieldName] [nvarchar](255),
[UserID] [int] NOT NULL,
[Data] [nvarchar](255)
)

A requirement has come up where some of these fields must contain Hebrew, or any other unicode character, data and some of the fields will be English. How can I go about saving and retrieving this information.

The current solution is a legacy Classic ASP application and I suspect I am going to have to redo this in ASP.Net

Thanks,
Leon

Since the data type in the table is nvarchar, you can store any unicode values.

You select/insert into the table as normal way of inserting the data there will not be any difference in doing DML operations.

Sample insert statement is as follows:

INSERT INTO TagData values(N'Sample Field', 10, N'Sample Data'); --> please "N" is for specifying it as nvarchar.

When you want to display content in ASP.Net depending on the language setting, we have to use localization and Globalization concepts in ASP.Net

Following URL will provide you more info on the same in ASP.Net:

http://www.codeproject.com/useritems/localization.asp

|||

I found this link which helped a lot.

http://www.microsoft.com/globaldev/getWR/steps/wrg_codepage.mspx

sql

Monday, March 12, 2012

MSSQLSERVER error(s) - severity and state

Hi
W2K3 std edition (no SP) - SQL Server Std SP3
I have a lot of errors showing up in app log on different days and times in
the form of:
***********************************
MSSQLSERVER, Category (2), Event ID: 17055
Description:
18052
Error: 3314, Severoty:21, State: 4
***********************************
The 'error' number varies between, 3314, 9001 and 823.
The account is always the same one.
Trawling through the SQL log - I can see some entries with the following
detail:
***********************************
database 'XYZ' cannot be opened. it has been marked SUSPECT by recovery. See
the event log for more information.
***********************************
DBCC CHECKDB shows no errors on this database.
Any pointers on this very much appreciated.
All SQL services are currently running.
Thanks
Bryan
If I were you, I would suck and backup as much of the data as you can
from the database files / disks. Seems to me that this is a hard error
inidcating that your underlying disks are about to die (or the
controller has a defect). Backup up and then checking / replacing the
databases would be the best to do. (for me)
HTH, Jens Suessmeyer.
|||Hi Jens
Thanks for the prompt reply.
Would this still be the case, as I have a whole bunch of DBs stting on the
same disk location.
I should have also noted that this is a SAN attached server.
Are there any particular tools (that are non intrusive as this is a
production server) that can check the integrity of a particular database
(other than DBCC CHECKDB/CHECKALLOC/CHECKCATALOG)?
Thanks
Bry
"Jens" wrote:

> If I were you, I would suck and backup as much of the data as you can
> from the database files / disks. Seems to me that this is a hard error
> inidcating that your underlying disks are about to die (or the
> controller has a defect). Backup up and then checking / replacing the
> databases would be the best to do. (for me)
> HTH, Jens Suessmeyer.
>
|||All of the errors point to disk problems, but given you are on a SAN(NAS?) I
would expect the problem is not hardware, but either overloading or
networking.
If you NAS/SAN configuration is not tuned properly, you could get the error
codes you listed.
Another possibility (which is why I added NAS rather than SAN) is that if
you have a bad or misconfigured switch, you could be seeing packe drops if
your server is 100MB and the switch port is 10MB.
Just ideas.
Joseph R.P. Maloney, CSP,CCP,CDP
"bryan" wrote:

> Hi
> W2K3 std edition (no SP) - SQL Server Std SP3
> I have a lot of errors showing up in app log on different days and times in
> the form of:
> ***********************************
> MSSQLSERVER, Category (2), Event ID: 17055
> Description:
> 18052
> Error: 3314, Severoty:21, State: 4
> ***********************************
> The 'error' number varies between, 3314, 9001 and 823.
> The account is always the same one.
> Trawling through the SQL log - I can see some entries with the following
> detail:
> ***********************************
> database 'XYZ' cannot be opened. it has been marked SUSPECT by recovery. See
> the event log for more information.
> ***********************************
> DBCC CHECKDB shows no errors on this database.
> Any pointers on this very much appreciated.
> All SQL services are currently running.
> Thanks
> Bryan
>
>
|||Hi Joseph
Thanks for your comments, always appreciated. I shall certainly take a look
at all your suggestions.
I will update any progress I make.
Best rgds
Bryan
"jrpm" wrote:
[vbcol=seagreen]
> All of the errors point to disk problems, but given you are on a SAN(NAS?) I
> would expect the problem is not hardware, but either overloading or
> networking.
> If you NAS/SAN configuration is not tuned properly, you could get the error
> codes you listed.
> Another possibility (which is why I added NAS rather than SAN) is that if
> you have a bad or misconfigured switch, you could be seeing packe drops if
> your server is 100MB and the switch port is 10MB.
> Just ideas.
> --
> Joseph R.P. Maloney, CSP,CCP,CDP
>
> "bryan" wrote:

MSSQLSERVER error(s) - severity and state

Hi
W2K3 std edition (no SP) - SQL Server Std SP3
I have a lot of errors showing up in app log on different days and times in
the form of:
***********************************
MSSQLSERVER, Category (2), Event ID: 17055
Description:
18052
Error: 3314, Severoty:21, State: 4
***********************************
The 'error' number varies between, 3314, 9001 and 823.
The account is always the same one.
Trawling through the SQL log - I can see some entries with the following
detail:
***********************************
database 'XYZ' cannot be opened. it has been marked SUSPECT by recovery. See
the event log for more information.
***********************************
DBCC CHECKDB shows no errors on this database.
Any pointers on this very much appreciated.
All SQL services are currently running.
Thanks
BryanIf I were you, I would suck and backup as much of the data as you can
from the database files / disks. Seems to me that this is a hard error
inidcating that your underlying disks are about to die (or the
controller has a defect). Backup up and then checking / replacing the
databases would be the best to do. (for me)
HTH, Jens Suessmeyer.|||Hi Jens
Thanks for the prompt reply.
Would this still be the case, as I have a whole bunch of DBs stting on the
same disk location.
I should have also noted that this is a SAN attached server.
Are there any particular tools (that are non intrusive as this is a
production server) that can check the integrity of a particular database
(other than DBCC CHECKDB/CHECKALLOC/CHECKCATALOG)?
Thanks
Bry
"Jens" wrote:
> If I were you, I would suck and backup as much of the data as you can
> from the database files / disks. Seems to me that this is a hard error
> inidcating that your underlying disks are about to die (or the
> controller has a defect). Backup up and then checking / replacing the
> databases would be the best to do. (for me)
> HTH, Jens Suessmeyer.
>|||All of the errors point to disk problems, but given you are on a SAN(NAS?) I
would expect the problem is not hardware, but either overloading or
networking.
If you NAS/SAN configuration is not tuned properly, you could get the error
codes you listed.
Another possibility (which is why I added NAS rather than SAN) is that if
you have a bad or misconfigured switch, you could be seeing packe drops if
your server is 100MB and the switch port is 10MB.
Just ideas.
--
Joseph R.P. Maloney, CSP,CCP,CDP
"bryan" wrote:
> Hi
> W2K3 std edition (no SP) - SQL Server Std SP3
> I have a lot of errors showing up in app log on different days and times in
> the form of:
> ***********************************
> MSSQLSERVER, Category (2), Event ID: 17055
> Description:
> 18052
> Error: 3314, Severoty:21, State: 4
> ***********************************
> The 'error' number varies between, 3314, 9001 and 823.
> The account is always the same one.
> Trawling through the SQL log - I can see some entries with the following
> detail:
> ***********************************
> database 'XYZ' cannot be opened. it has been marked SUSPECT by recovery. See
> the event log for more information.
> ***********************************
> DBCC CHECKDB shows no errors on this database.
> Any pointers on this very much appreciated.
> All SQL services are currently running.
> Thanks
> Bryan
>
>|||Hi Joseph
Thanks for your comments, always appreciated. I shall certainly take a look
at all your suggestions.
I will update any progress I make.
Best rgds
Bryan
"jrpm" wrote:
> All of the errors point to disk problems, but given you are on a SAN(NAS?) I
> would expect the problem is not hardware, but either overloading or
> networking.
> If you NAS/SAN configuration is not tuned properly, you could get the error
> codes you listed.
> Another possibility (which is why I added NAS rather than SAN) is that if
> you have a bad or misconfigured switch, you could be seeing packe drops if
> your server is 100MB and the switch port is 10MB.
> Just ideas.
> --
> Joseph R.P. Maloney, CSP,CCP,CDP
>
> "bryan" wrote:
> > Hi
> >
> > W2K3 std edition (no SP) - SQL Server Std SP3
> >
> > I have a lot of errors showing up in app log on different days and times in
> > the form of:
> >
> > ***********************************
> > MSSQLSERVER, Category (2), Event ID: 17055
> > Description:
> > 18052
> > Error: 3314, Severoty:21, State: 4
> > ***********************************
> > The 'error' number varies between, 3314, 9001 and 823.
> >
> > The account is always the same one.
> >
> > Trawling through the SQL log - I can see some entries with the following
> > detail:
> >
> > ***********************************
> > database 'XYZ' cannot be opened. it has been marked SUSPECT by recovery. See
> > the event log for more information.
> > ***********************************
> >
> > DBCC CHECKDB shows no errors on this database.
> > Any pointers on this very much appreciated.
> >
> > All SQL services are currently running.
> >
> > Thanks
> > Bryan
> >
> >
> >

MSSQLSERVER error(s) - severity and state

Hi
W2K3 std edition (no SP) - SQL Server Std SP3
I have a lot of errors showing up in app log on different days and times in
the form of:
***********************************
MSSQLSERVER, Category (2), Event ID: 17055
Description:
18052
Error: 3314, Severoty:21, State: 4
***********************************
The 'error' number varies between, 3314, 9001 and 823.
The account is always the same one.
Trawling through the SQL log - I can see some entries with the following
detail:
***********************************
database 'XYZ' cannot be opened. it has been marked SUSPECT by recovery. See
the event log for more information.
***********************************
DBCC CHECKDB shows no errors on this database.
Any pointers on this very much appreciated.
All SQL services are currently running.
Thanks
BryanIf I were you, I would suck and backup as much of the data as you can
from the database files / disks. Seems to me that this is a hard error
inidcating that your underlying disks are about to die (or the
controller has a defect). Backup up and then checking / replacing the
databases would be the best to do. (for me)
HTH, Jens Suessmeyer.|||Hi Jens
Thanks for the prompt reply.
Would this still be the case, as I have a whole bunch of DBs stting on the
same disk location.
I should have also noted that this is a SAN attached server.
Are there any particular tools (that are non intrusive as this is a
production server) that can check the integrity of a particular database
(other than DBCC CHECKDB/CHECKALLOC/CHECKCATALOG)?
Thanks
Bry
"Jens" wrote:

> If I were you, I would suck and backup as much of the data as you can
> from the database files / disks. Seems to me that this is a hard error
> inidcating that your underlying disks are about to die (or the
> controller has a defect). Backup up and then checking / replacing the
> databases would be the best to do. (for me)
> HTH, Jens Suessmeyer.
>|||All of the errors point to disk problems, but given you are on a SAN(NAS?) I
would expect the problem is not hardware, but either overloading or
networking.
If you NAS/SAN configuration is not tuned properly, you could get the error
codes you listed.
Another possibility (which is why I added NAS rather than SAN) is that if
you have a bad or misconfigured switch, you could be seeing packe drops if
your server is 100MB and the switch port is 10MB.
Just ideas.
--
Joseph R.P. Maloney, CSP,CCP,CDP
"bryan" wrote:

> Hi
> W2K3 std edition (no SP) - SQL Server Std SP3
> I have a lot of errors showing up in app log on different days and times i
n
> the form of:
> ***********************************
> MSSQLSERVER, Category (2), Event ID: 17055
> Description:
> 18052
> Error: 3314, Severoty:21, State: 4
> ***********************************
> The 'error' number varies between, 3314, 9001 and 823.
> The account is always the same one.
> Trawling through the SQL log - I can see some entries with the following
> detail:
> ***********************************
> database 'XYZ' cannot be opened. it has been marked SUSPECT by recovery. S
ee
> the event log for more information.
> ***********************************
> DBCC CHECKDB shows no errors on this database.
> Any pointers on this very much appreciated.
> All SQL services are currently running.
> Thanks
> Bryan
>
>|||Hi Joseph
Thanks for your comments, always appreciated. I shall certainly take a look
at all your suggestions.
I will update any progress I make.
Best rgds
Bryan
"jrpm" wrote:
[vbcol=seagreen]
> All of the errors point to disk problems, but given you are on a SAN(NAS?)
I
> would expect the problem is not hardware, but either overloading or
> networking.
> If you NAS/SAN configuration is not tuned properly, you could get the erro
r
> codes you listed.
> Another possibility (which is why I added NAS rather than SAN) is that if
> you have a bad or misconfigured switch, you could be seeing packe drops if
> your server is 100MB and the switch port is 10MB.
> Just ideas.
> --
> Joseph R.P. Maloney, CSP,CCP,CDP
>
> "bryan" wrote:
>