Not finding GUID value after migration sql 2005 to 2000



Dear all,

I'd like to ask for your advice in the following problem:
I've developed a web app using sql 2005. Now that I've migrated the
files to the definitive server which is running sql 2000 I'm running
into a problem. The root application that I'm hooking into stores
(after successful login) a guid value in the ASP.NET
Page.User.Identity.Name variable. My application takes that value and
uses that as a parameter for a sql query to retrieve the user's data,
which works fine on my 2005 server but breaks on the 2000 server.
The error returned is 'no row at position 0' at the row where it says
'GetUserByGuid(guid)[0]'; manual checking (logging into the 2000
server from a 2005 management studio express) seems to work fine: i've
outputted the guid value and manually created the query it should
generate which in turn returns the correct (1) data row. Logon issues
seem to be excluded as changing the password in web.config results in
a different (could not log in) error message.
The only thing I can think of is that sql 2000 is somehow more fussy
when it comes to uniqueidentifier values than 2005 is. Can anybody
confirm this and/or does someone have a suggestion on how to fix this?

Code snippet:

Index.aspx:
protected void Page_Load(object sender, EventArgs e) {
// Set user name
if (!IsPostBack)
Username.Text = _user.FullName;
/* Username is a div-tag; replacing '_user.FullName' with
'User.Identity.Name' outputs a GUID value that is valid in the
database, so the value should be retrieved correctly */
}

private EllipsDossierDAL.ellipsUserRow _user {
get {
// Retrieve information through the stored GUID
string guid = User.Identity.Name;
EllipsDossierDAL.ellipsUserRow user = new
UsersBLL().GetUserByGuid(guid)[0];
_userid = user.ID; // remember ID
return user;
}
}

UsersBLL.cs:
[DataObjectMethodAttribute(DataObjectMethodType.Select,
false)]
public EllipsDossierDAL.ellipsUserDataTable
GetUserByGuid(string guid) {
return Adapter.GetUserByGuid(new Guid(guid));
}

EllipsDossierDAL.xsd:
<DbSource ConnectionRef="EllipsConnectionString
(Web.config)" DbObjectName="ellips.dbo.ellipsUser"
DbObjectType="Table" FillMethodModifier="Public"
FillMethodName="FillByGuid" GenerateMethods="Both"
GenerateShortCommands="True" GeneratorGetMethodName="GetUserByGuid"
GeneratorSourceName="FillByGuid" GetMethodModifier="Public"
GetMethodName="GetUserByGuid" QueryType="Rowset"
ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
UseOptimisticConcurrency="True" UserGetMethodName="GetUserByGuid"
UserSourceName="FillByGuid">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="True">
<CommandText>SELECT ID, firstname, middlename,
lastname, login, password, RoleID, email, AgreementIsSigned, guest,
IsNull(firstname, '') + ' ' + IsNull(middlename, '') + ' ' +
IsNull(lastname, '') AS FullName
FROM ellipsUser
LEFT JOIN EllipsUserSession ON ellipsUser.ID =
EllipsUserSession.fkUser
WHERE EllipsUserSession.[GUID] = @GUID
ORDER BY lastname, firstname, ID</CommandText>
<Parameters>
<Parameter AllowDbNull="False"
AutogeneratedName="GUID" ColumnName="GUID"
DataSourceName="ellips.dbo.EllipsUserSession"
DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input"
ParameterName="@GUID" Precision="0" ProviderType="UniqueIdentifier"
Scale="0" Size="16" SourceColumn="GUID"
SourceColumnNullMapping="False" SourceVersion="Current">
</Parameter>
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
.



Relevant Pages

  • Re: GUIDS / Access und SQL Server / Escape Zeichen
    ... Schau mal in Access unter den beiden Funktionen ... Mach mit der einen aus deinem Guid einen String, speichere den im SQL ... Server, beim Zurückladen kannst du mit der anderen Funktionen aus dem String ...
    (microsoft.public.de.access)
  • Re: VS.NET 2003, ADO.NET 1.1 and Access 2000: Getting a Concurrency violation
    ... Then my app goes against a SQL ... Server 2000 database, retrieves other data and updates about 500 ... OleDbDataAdapter that I use to retrieve the original table from the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Master/Detail with ADODatasets (again)
    ... So that means the SQL statements use to retrieve data from the ... I just set the CommandText in Patients to 'Select ... then save it back to the server before moving on to the ...
    (borland.public.delphi.database.ado)
  • Re: Daten abrufbereit halten
    ... oder ist der Server sowieso ... eine GUID>" dabei). ... Datenbankarchitektur: Das Speichermodul ... - Optimale Performance mit SQL Server 2000 ...
    (microsoft.public.de.sqlserver)
  • CONTAINSTABLE with individual RANK?
    ... sorted by our own score column. ... This was not possible in SQL ... Server 2005, it is only possilby to dig up based on the RANK. ... of course possible to retrieve everything and then used an ORDER BY ...
    (microsoft.public.sqlserver.fulltext)