Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Strings in database only have first characterStrings in database only have first character
Previous
 
Next
New Post
4/1/2009 9:18 PM
 

Hi. I'm creating a simple module that uses DAL+ along with stored procedures to insert into a SQL Server table.

The table has columns defined as nvarchar(50). In the module code, I use something like this:

Dim myString As String = "test"
DataProvider.Instance().ExecuteNonQuery("OS_AddRecord", myString)

The stored procedure does a simple INSERT INTO using the supplied nvarchar parameter -- nothing special.

When I query the table or pull records back, the only the first character of the string is actually inserted into the table. I have confirmed that only the first character of the string is making it to the stored procedure.

This sounds like a Unicode/Ansi issue, but I don't know where to look. I've followed the many basic DAL+ examples online and don't see anywhere that I have to do anything special with strings.

Thanks for your help!

 
New Post
4/2/2009 3:29 PM
 

In case this will help anyone else...

I found that if I create the stored procedures with ntext parameters instead of nvarchar/varchar, the data gets inserted correctly (even though the columns are defined as nvarchar).

 
New Post
4/2/2009 4:29 PM
 

 did you provide proper sizes for the nvarchar variables inside your stored procedure? I assume, if the size is not given, the default is 1 :)


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Strings in database only have first characterStrings in database only have first character


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out