Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Not finding GUI...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 11147 of 11517
Post > Topic >>

Not finding GUID value after migration sql 2005 to 2000

by Zark3 <Zark3net@[EMAIL PROTECTED] > Jun 17, 2008 at 01:19 AM

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] = @[EMAIL PROTECTED]
 BY lastname, firstname, ID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False"
AutogeneratedName="GUID" ColumnName="GUID"
DataSourceName="ellips.dbo.EllipsUserSession"
DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input"
ParameterName="@[EMAIL PROTECTED]
" Precision="0" ProviderType="UniqueIdentifier"
Scale="0" Size="16" SourceColumn="GUID"
SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
 




 8 Posts in Topic:
Not finding GUID value after migration sql 2005 to 2000
Zark3 <Zark3net@[EMAIL  2008-06-17 01:19:41 
Re: Not finding GUID value after migration sql 2005 to 2000
Zark3 <Zark3net@[EMAIL  2008-06-17 01:28:27 
Re: Not finding GUID value after migration sql 2005 to 2000
--CELKO-- <jcelko212@[  2008-06-17 08:40:25 
Re: Not finding GUID value after migration sql 2005 to 2000
"Tony Rogerson"  2008-06-19 07:34:31 
Re: Not finding GUID value after migration sql 2005 to 2000
"Tony Rogerson"  2008-06-19 07:37:38 
Re: Not finding GUID value after migration sql 2005 to 2000
Zark3 <Zark3net@[EMAIL  2008-06-17 12:45:21 
Re: Not finding GUID value after migration sql 2005 to 2000
Erland Sommarskog <esq  2008-06-17 22:07:45 
Re: Not finding GUID value after migration sql 2005 to 2000
"Tony Rogerson"  2008-06-19 07:28:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 1:16:18 CST 2008.