2015-01-04 21:08
anzelmute
Klaidos duomenys:
Klaidos tekstas:
DataPortal.Fetch failed (System.Exception: Klaida. Nepavyko sukurti vartotojų duomenų bazės. ---> System.Exception: KRITINĖ DUOMENŲ BAZĖS KLAIDA. Nebaigta kurti vartotojų duomenų bazė. ---> System.Exception: Klaida vykdant sakinį (statement): CREATE PROCEDURE financsec.AccLogin()
BEGIN
DECLARE s INT;
DECLARE n CHAR(100);
SET s=(SELECT COUNT(u.Name) FROM users u);
IF s<1 THEN INSERT INTO users(Name, RealName, Password, UserPosition, UserDetails, UserLevel) VALUES('root','','','','',0); END IF;
IF s<1 THEN INSERT INTO roles(UserID, DatabaseName, RoleName, RoleLevel) VALUES(Last_Insert_ID(), '','Admin', 3); END IF;
SET s=(SELECT LOCATE('@', REPLACE(REPLACE(USER(), '\'', ''), '`', '')));
IF s>1 THEN SET n=(SELECT LOWER(SUBSTR(REPLACE(REPLACE(USER(), '\'', ''), '`', ''), 1,
LOCATE('@', REPLACE(REPLACE(USER(), '\'', ''), '`', ''))-1))); END IF;
IF s<2 THEN SET n=(SELECT REPLACE(REPLACE(USER(), '\'', ''), '`', '')); END IF;
SET s=(SELECT COUNT(u.Name) FROM users u WHERE INSTR(LOWER(USER()), CONCAT(LOWER(u.Name), '@'))=1);
IF s<1 THEN INSERT INTO users(Name, RealName, Password, UserPosition, UserDetails, UserLevel)
VALUES(n,'','','','', 0); END IF;
SELECT u.Name, (SELECT COUNT(r.ID) FROM roles r WHERE r.UserID=u.ID AND LOWER(TRIM(r.RoleName))='admin') AS IsAdmin, u.RealName
FROM users u WHERE INSTR(LOWER(USER()), CONCAT(LOWER(u.Name), '@'))=1;
END
Klaidos turinys: 'No database selected'. ---> MySql.Data.MySqlClient.MySqlException: No database selected
at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.ExecuteUsingConnection(MySqlConnection Conn, SQLCommand myComm)
--- End of inner exception stack trace ---
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.ExecuteUsingConnection(MySqlConnection Conn, SQLCommand myComm)
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.CreateUserDatabase(MySqlConnection Conn, AccIdentity CurrentIdentity)
--- End of inner exception stack trace ---
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.CreateUserDatabase(MySqlConnection Conn, AccIdentity CurrentIdentity)
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.TryLogin(AccIdentity CurrentIdentity, List`1& cRoles)
--- End of inner exception stack trace ---
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.TryLogin(AccIdentity CurrentIdentity, List`1& cRoles)
at AccDataAccessLayer.DatabaseAccess.SQLUtilities.TryLogin(AccIdentity CurrentIdentity, List`1& cRoles)
at AccDataAccessLayer.Security.AccIdentity.TryAuthenticateWithIdentity(AccIdentity& nIdentity)
at AccDataAccessLayer.Security.AccIdentity.DataPortal_Fetch(Criteria criteria))
Klaidos šaltinis(Ex.Source):
Csla
Klaidos metodas (Ex.TargetSite):
Fetch
Klaidos stekas:
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.TryLogin(AccIdentity CurrentIdentity, List`1& cRoles)
at AccDataAccessLayer.DatabaseAccess.SQLUtilities.TryLogin(AccIdentity CurrentIdentity, List`1& cRoles)
at AccDataAccessLayer.Security.AccIdentity.TryAuthenticateWithIdentity(AccIdentity& nIdentity)
at AccDataAccessLayer.Security.AccIdentity.DataPortal_Fetch(Criteria criteria)
at Csla.MethodCaller.CallMethod(Object obj, MethodInfo info, Object[] parameters)
at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context)
at Csla.DataPortal.Fetch(Type objectType, Object criteria)
at Csla.DataPortal.Fetch[T](Object criteria)
at AccDataAccessLayer.Security.AccIdentity.GetIdentity(String cUsername, String cPassword, String cSQLServer, String cSQLPort, SqlServerType cSqlServerType, String cDatabaseNamingConvention, Boolean cUseSSL, String cSslCertificateFileName, String cSslCertificatePassword, Boolean cSslCertificateInstalled, Boolean cCannotSetGrants, ICacheManager cCacheManager)
at AccDataAccessLayer.Security.AccPrincipal.Login(LocalUser cLocalUser, String cPassword, ICacheManager cCacheManager)
at ApskaitaWUI.F_Login.LoginButton_Click(Object sender, EventArgs e)
----------------------------
Vidinės klaidos (internal exception) duomenys:
Klaidos tekstas:
DataPortal_Fetch method call failed
Klaidos šaltinis(Ex.Source):
Csla
Klaidos metodas (Ex.TargetSite):
CallMethod
Klaidos stekas:
at AccDataAccessLayer.SqlServerSpecificMethods.MySqlCommandManager.TryLogin(AccIdentity CurrentIdentity, List`1& cRoles)
at AccDataAccessLayer.DatabaseAccess.SQLUtilities.TryLogin(AccIdentity CurrentIdentity, List`1& cRoles)
at AccDataAccessLayer.Security.AccIdentity.TryAuthenticateWithIdentity(AccIdentity& nIdentity)
at AccDataAccessLayer.Security.AccIdentity.DataPortal_Fetch(Criteria criteria)
at Csla.MethodCaller.CallMethod(Object obj, MethodInfo info, Object[] parameters)
at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context)