Showing posts with label insert. Show all posts
Showing posts with label insert. Show all posts

Wednesday, March 28, 2012

Text field is empty

I'm trying to insert a record on an sql server database table that has
among others a text type field. The insert happens without errors and
all the fields show the correct information except for the text field
when the number of characters is larger than 900. In this case the text
field appears empty. If the text is less or equal to 900 characters
they are inserted with no problem.

In this case have a stored procedure with several input variables
including the text one and a asp.net page with a command that is filled
with the several parameters necessary to run the procedure. One of them
is the text parameter that is defined as follows:

insertcommand.Parameters.Add(New SqlParameter("@dotnet.itags.org.texto", SqlDbType.Text,
2147483647))
insertcommand.Parameters("@dotnet.itags.org.texto").Value = texto.Text
Does someone knows what is causing this problem ?

ThanksHi,

Why do you think it's empty?
Normally, when you use SQL Server Enterprise Manager to
open a table with text field, it shows actual content when
it's <= 900 characters, but <Long Text> when it's > 900
characters. Actual content is in table. If you use Select
query in Query Analyzer, you can see the difference.

Hope it's helpful
Elton Wang
elton_wang@.hotmail.com

>--Original Message--
>I'm trying to insert a record on an sql server database
table that has
>among others a text type field. The insert happens
without errors and
>all the fields show the correct information except for
the text field
>when the number of characters is larger than 900. In this
case the text
>field appears empty. If the text is less or equal to 900
characters
>they are inserted with no problem.
>In this case have a stored procedure with several input
variables
>including the text one and a asp.net page with a command
that is filled
>with the several parameters necessary to run the
procedure. One of them
>is the text parameter that is defined as follows:
>insertcommand.Parameters.Add(New SqlParameter("@.texto",
SqlDbType.Text,
>2147483647))
>insertcommand.Parameters("@.texto").Value = texto.Text
>Does someone knows what is causing this problem ?
>Thanks
>.
Yo're right, Elton. I didn't knew about the EM limitation. Once I used
the QA the information appeared. Thanks!

Text field is empty

I'm trying to insert a record on an sql server database table that has
among others a text type field. The insert happens without errors and
all the fields show the correct information except for the text field
when the number of characters is larger than 900. In this case the text
field appears empty. If the text is less or equal to 900 characters
they are inserted with no problem.
In this case have a stored procedure with several input variables
including the text one and a asp.net page with a command that is filled
with the several parameters necessary to run the procedure. One of them
is the text parameter that is defined as follows:
insertcommand.Parameters.Add(New SqlParameter("@dotnet.itags.org.texto", SqlDbType.Text,
2147483647))
insertcommand.Parameters("@dotnet.itags.org.texto").Value = texto.Text
Does someone knows what is causing this problem ?
ThanksYo're right, Elton. I didn't knew about the EM limitation. Once I used
the QA the information appeared. Thanks!

text file

I have a text file that i have to read and insert into a database table. The
files has over 30 lines of data in it, I need to start inserting data from
line 8 in the file. How can I start inserting the data from line 8 of my tex
t
file? So from line 1-7 are read only (headers) and starting with line 8 need
s
to be inserted into the table.Hi,
you could use StreamReader which has ReadLine method. You could use it to
skip the first 8 lines, and then go about teading it line by line.
StreamReader.ReadLine
http://msdn.microsoft.com/library/d...adLineTopic.asp
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"CsharpGuy" <CsharpGuy@.discussions.microsoft.com> wrote in message
news:15EBF9C2-7859-4EEF-A33E-8A64131ABCCC@.microsoft.com...
>I have a text file that i have to read and insert into a database table.
>The
> files has over 30 lines of data in it, I need to start inserting data from
> line 8 in the file. How can I start inserting the data from line 8 of my
> text
> file? So from line 1-7 are read only (headers) and starting with line 8
> needs
> to be inserted into the table.
>

Monday, March 26, 2012

text file

I have a text file that i have to read and insert into a database table. The
files has over 30 lines of data in it, I need to start inserting data from
line 8 in the file. How can I start inserting the data from line 8 of my text
file? So from line 1-7 are read only (headers) and starting with line 8 needs
to be inserted into the table.Hi,

you could use StreamReader which has ReadLine method. You could use it to
skip the first 8 lines, and then go about teading it line by line.

StreamReader.ReadLine
http://msdn.microsoft.com/library/d...adLineTopic.asp

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"CsharpGuy" <CsharpGuy@.discussions.microsoft.com> wrote in message
news:15EBF9C2-7859-4EEF-A33E-8A64131ABCCC@.microsoft.com...
>I have a text file that i have to read and insert into a database table.
>The
> files has over 30 lines of data in it, I need to start inserting data from
> line 8 in the file. How can I start inserting the data from line 8 of my
> text
> file? So from line 1-7 are read only (headers) and starting with line 8
> needs
> to be inserted into the table.

Thursday, March 22, 2012

textBox

in C# for asp. i have a textbox, and at the point of doing an INSERT to my
table, it is cutting it off at the point where end users press Return (the
next line).

in other words, in a multiline textbox which allows up to 4000 characters,
if the end users presses a key to go to the next line it doesn't add the next
line to sql?

stringbuilder has my comments something like:
string myComments = "123456789 are my numbers/nBut here the line is broken"
/n is where it stops. i'm sure doing a replace for this will fix it, but is
there a better way?How do you know it is cutting off your string? Are you looking at in in
Enterprise Manager or when your content renders?

"ae" <ae@.discussions.microsoft.com> wrote in message
news:CF42C75A-C2ED-4169-BE86-B0928AE3EBCC@.microsoft.com...
> in C# for asp. i have a textbox, and at the point of doing an INSERT to
> my
> table, it is cutting it off at the point where end users press Return (the
> next line).
> in other words, in a multiline textbox which allows up to 4000 characters,
> if the end users presses a key to go to the next line it doesn't add the
> next
> line to sql?
> stringbuilder has my comments something like:
> string myComments = "123456789 are my numbers/nBut here the line is
> broken"
> /n is where it stops. i'm sure doing a replace for this will fix it, but
> is
> there a better way?
Both.

In enterprise Mgr. i only get the first 16 characters. I did two changes
and it fixed it, i had the field type set as text with the default of 16.
that might of caused it, but I doubt it since it only had 4 characters at one
point.

it's corrected now, I changed the field to nvarchar from text in sql, and
with a stringbuilder used something like: strInput = Replace("\n", (" ")
and did another for the "\r". All is well.

"Peter Rilling" wrote:

> How do you know it is cutting off your string? Are you looking at in in
> Enterprise Manager or when your content renders?
> "ae" <ae@.discussions.microsoft.com> wrote in message
> news:CF42C75A-C2ED-4169-BE86-B0928AE3EBCC@.microsoft.com...
> > in C# for asp. i have a textbox, and at the point of doing an INSERT to
> > my
> > table, it is cutting it off at the point where end users press Return (the
> > next line).
> > in other words, in a multiline textbox which allows up to 4000 characters,
> > if the end users presses a key to go to the next line it doesn't add the
> > next
> > line to sql?
> > stringbuilder has my comments something like:
> > string myComments = "123456789 are my numbers/nBut here the line is
> > broken"
> > /n is where it stops. i'm sure doing a replace for this will fix it, but
> > is
> > there a better way?
>

Tuesday, March 13, 2012

textBox

in C# for asp. i have a textbox, and at the point of doing an INSERT to my
table, it is cutting it off at the point where end users press Return (the
next line).
in other words, in a multiline textbox which allows up to 4000 characters,
if the end users presses a key to go to the next line it doesn't add the nex
t
line to sql?
stringbuilder has my comments something like:
string myComments = "123456789 are my numbers/nBut here the line is broken"
/n is where it stops. i'm sure doing a replace for this will fix it, but is
there a better way?How do you know it is cutting off your string? Are you looking at in in
Enterprise Manager or when your content renders?
"ae" <ae@.discussions.microsoft.com> wrote in message
news:CF42C75A-C2ED-4169-BE86-B0928AE3EBCC@.microsoft.com...
> in C# for asp. i have a textbox, and at the point of doing an INSERT to
> my
> table, it is cutting it off at the point where end users press Return (the
> next line).
> in other words, in a multiline textbox which allows up to 4000 characters,
> if the end users presses a key to go to the next line it doesn't add the
> next
> line to sql?
> stringbuilder has my comments something like:
> string myComments = "123456789 are my numbers/nBut here the line is
> broken"
> /n is where it stops. i'm sure doing a replace for this will fix it, but
> is
> there a better way?
Both.
In enterprise Mgr. i only get the first 16 characters. I did two changes
and it fixed it, i had the field type set as text with the default of 16.
that might of caused it, but I doubt it since it only had 4 characters at on
e
point.
it's corrected now, I changed the field to nvarchar from text in sql, and
with a stringbuilder used something like: strInput = Replace("\n", (" ")
and did another for the "\r". All is well.
"Peter Rilling" wrote:

> How do you know it is cutting off your string? Are you looking at in in
> Enterprise Manager or when your content renders?
> "ae" <ae@.discussions.microsoft.com> wrote in message
> news:CF42C75A-C2ED-4169-BE86-B0928AE3EBCC@.microsoft.com...
>
>

textbox and the tab key

What's the best way to prevent the tab key from shifting focus away from a
textbox, but rather insert the tab character? Do I just do it the obvious
way with JavaScript or is there some simple property to set?
PaulPJ6 wrote:
> What's the best way to prevent the tab key from shifting focus away from a
> textbox, but rather insert the tab character? Do I just do it the obvious
> way with JavaScript or is there some simple property to set?
> Paul
I'd simply change the textbox to a "multiple line" textbox also known
as the textarea in HTML forms. You can have a textarea in same height
as a textbox so the design doesn't get crushed by it. The textarea
supports the tab character and you're done :)
-Kevin
Um... already have a multiple line textarea. Tab still alters focus. Is it
just an IE problem?
Paul
"Kevin Steffer [MCP]" <ksteffer@.gmail.com> wrote in message
news:1133899279.462906.116050@.g44g2000cwa.googlegroups.com...
> PJ6 wrote:
> I'd simply change the textbox to a "multiple line" textbox also known
> as the textarea in HTML forms. You can have a textarea in same height
> as a textbox so the design doesn't get crushed by it. The textarea
> supports the tab character and you're done :)
> -Kevin
>
the <textarea> doesn't support tab entry (other than a paste). you can use
client script to do it though, through the onkeydown event. if the key is a
tab, insert the tab char into the current postion..
-- bruce (sqlwork.com)
"PJ6" <nobody@.nowhere.net> wrote in message
news:O1Gp%234p%23FHA.2452@.TK2MSFTNGP11.phx.gbl...
> What's the best way to prevent the tab key from shifting focus away from a
> textbox, but rather insert the tab character? Do I just do it the obvious
> way with JavaScript or is there some simple property to set?
> Paul
>
Yeah, that's what I thought I had to do :-/
Thanks,
Paul
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:OcREbjq%23FHA.4092@.TK2MSFTNGP10.phx.gbl...
> the <textarea> doesn't support tab entry (other than a paste). you can use
> client script to do it though, through the onkeydown event. if the key is
> a tab, insert the tab char into the current postion..
> -- bruce (sqlwork.com)
>
> "PJ6" <nobody@.nowhere.net> wrote in message
> news:O1Gp%234p%23FHA.2452@.TK2MSFTNGP11.phx.gbl...
>