473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Nchars as PrimaryKeys

markmcgookin
648 Expert 512MB
Hi All,

I am working on a project at the moment using SQL Server CE and in my login/user details database I have a user table with the individual username as a primary key.

I am trying to query this using entityspaces LoadByPrimaryKey function, which works fine.... but only if the username is all text, if I throw a numeric character in there it always comes back false.

I can't understand this as they are all essentially characters, the DB knows they are not numeric values, and I have tried explicit convert.toString type methods on the variable being passed, but none of this seems to work.

Does anyone have any ideas/solutions to this kind of thing? Or has anyone experienced it before.

Cheers,

Mark
Aug 7 '07 #1
2 1509
RedSon
5,000 Expert 4TB
Is your database expecting a buffer of chars but you throw a number in there and interprets it as a value thereby making the array invalid?

This sounds more like a database engine problem then a embedded/mobile problem. What database are you using?
Aug 8 '07 #2
markmcgookin
648 Expert 512MB
Is your database expecting a buffer of chars but you throw a number in there and interprets it as a value thereby making the array invalid?

This sounds more like a database engine problem then a embedded/mobile problem. What database are you using?
It was SQL Server CE 3.0. I still have no idea why it was happening, but fortunatly I solved another problem that was forcing me to use the Nchar as the PK and now have a uniqueidentifier guid based entity, thus avoiding having to deal with this problem! hehe :P
Aug 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: alex | last post by:
how do i initialize an LPTSTR variable? i'm trying to call a microsoft function LONG QueryStringValue( LPCTSTR pszValueName, LPTSTR pszValue, ULONG* pnChars ) throw( );pszValue is supposed...
19
by: Lionel B | last post by:
Greetings, I need to read (unformatted text) from stdin up to EOF into a char buffer; of course I cannot allocate my buffer until I know how much text is available, and I do not know how much...
5
by: serge | last post by:
How can i enter Default Values of " " to all the columns of type character of all the tables (excluding system tables) and Default Values of 0 of all columns of type numbers. Excluding all primary...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
5
by: Lars Netzel | last post by:
Hello! I have 4 tables where the first is parent of the second and second parent of the the third and so on... These I need to have as Datagrids loaded from access (one grid for each table,...
6
by: Gerrit | last post by:
Hello, I try to display the fieldnames and the primary key of a table, with this code: using System; using System.Collections.Generic; using System.Text; using System.Data; using...
3
by: ilan pillemer | last post by:
Hi, I have made an attempt at exercise 1.14 in K&R2: namely; "Write a program to print a histogram of the frequencies of different characters in its input." Here is my program and the...
0
by: Sebastijan | last post by:
Hi I am interested in DbConnection.GetSchema method of ODP.NET oracle library. When I call (to get primary keys metadata) DataTable pkeys = DbConnection.GetSchema("PrimaryKeys"... foreach...
4
by: Paul David Buchan | last post by:
Hello, I'm attempting to write a program to read in database files (.dbf). When I do it all as a single procedure in main, everything works. However, what I really want, is to pass the database...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.