Jump to content


  • Posts

  • Joined

  • Last visited

DaNuGai's Achievements


Newbie (1/7)



  1. DaNuGai

    Access to SQL

    Found a solution :-D SELECT CASE WHEN RolesByUser.RoleId Is Null THEN 'N' ELSE 'Y' END AS isUserInRole, Roles.RoleId, Roles.RoleNameFROM Roles LEFT JOIN (SELECT UsersInRoles.RoleId FROM UsersInRoles WHERE UsersInRoles.UserId=@UserId) AS RolesByUser ON Roles.RoleId = RolesByUser.RoleId
  2. DaNuGai

    Access to SQL

    I have a couple of queries in Access database that does exactly what I want. However, I want to convert this into an SQL Query but I'm not quite sure how I can go about doing that.Here is my First Ruery RolesByUser where UserId is provided dynamically through a parameter @UserId SELECT UsersInRoles.RoleIdFROM UsersInRolesWHERE UsersInRoles.UserId=[Enter UserId]; Here is Second Query that uses the query above: SELECT IIf(RolesByUser.RoleId Is Null,"N","Y") AS isUserInRole, Roles.RoleId, Roles.RoleNameFROM Roles LEFT JOIN RolesByUser ON Roles.RoleId = RolesByUser.RoleId; The result would look similar to a sample below (minus "..."):isUserInRole.....RoleId.....RoleName=======================Y.....................1............SupervisorN.....................2............ManagerThanks in advance
  3. DaNuGai

    FireFox Select

    I have reset the margin and padding in my CSS for all pages. * {margin: 0; padding: 0;} So for the dropdownlist, I decided to set the height in the style but that doesn't seem to work in FireFox. Is there a way to not reset the dropdownlist for all pages? In other words, what css elements can I use to set the dropdownlist to the way it used to look?Thanks in advance.
  4. Suppose I have an authentication ticket with timeout="30" & slidingExpiration="true" and I also have <sessionState timeout="30" /> under web.config.Now, correct me if I am wrong but both of them should expire at the same time if a user becomes idle after logging in, correct? So what happens when a user is logged and he/she is not idle? How and when does sliding expiration kicks in?Thanks in advance.
  5. It's tough to understand your question. Can you explain it in detail?
  6. DaNuGai

    Https Aspx Swf

    I have few flash (swf) files that are on a secured web application. Now each time a user visits this page, they get a message saying "This page contains both secure and non secure items". Is there a way to get rid of this message? Also, is there a way to secure swf files so they don't get downloaded to the user's temp folder?The whole idea is to secure the swf files but at the same time allow a small group of users to view them online. Is this even possible?Thanks in advance.
  7. Yeah I found that website when I googled SQL Triggers but I don't know what I was doing wrong but I wasn't able to replicate what I had listed above.Thanks for your help though.
  8. I've used the code below for a MySQL database and it worked fine. However, now I am using an SQL 2005 database and I am trying to replicate the code below but I am having trouble converting the triggers. I understand that I can't use TIMESTAMP and instead I have to go with DATETIME data type but how do you write the same trigger for SQL 2005 database so it functions similar to the way it did in MySQL database.Thanks in advance. CREATE TABLE EVENT ( EventID INT UNSIGNED NOT NULL AUTO_INCREMENT, DateFrom DATE NOT NULL, DateTo DATE NOT NULL, EventTitle VARCHAR(50) NOT NULL, Event TEXT NOT NULL, Created TIMESTAMP DEFAULT '0000-00-00 00:00:00', Updated TIMESTAMP DEFAULT '0000-00-00 00:00:00', PRIMARY KEY(EventID));CREATE TRIGGER EVENT_TIME_CREATED BEFORE INSERT ON EVENT FOR EACH ROW SET NEW.Created = NOW(), NEW.Updated = '0000-00-00 00:00:00';CREATE TRIGGER EVENT_TIME_UPDATED BEFORE UPDATE ON EVENT FOR EACH ROW SET NEW.Updated = NOW(), NEW.Created = OLD.Created;
  9. Thanks for your reply but it doesn't work. I've tried the following strings and they all failed: I want a regular expression where the top two fails and rest of them should pass
  10. I am using the following regular expression ^([01]?[0-9]|2[0-3])(:([0-5][0-9]))$ It works fine. However, I just want to exclude the following matches Does anyone know how? Thanks in advance.
  11. Thank you so much JustSomeGuy I appreciate your help.
  12. That's what I thought too but I am getting the same results on the following website as well...Validator
  13. Thanks for your quick reply.I don't mean to be a pain but I am using the following site to test out the regular expressions and I am not getting the same results.Regular Expression Validator
  14. Thanks for your reply. By the way, the regular expression you gave me doesn't seem to work properly.If the first string is longer than 8 characters, it still returns true.Also, I am only want to use alpha characters (no Numberic and no Special characters). I tried something like ([A-Za-z]){1,8}\\([A-Za-z])+ and it doesnt' work as well.Thanks again for your help. I appreciate it.
  15. I am looking for a regular expression for "Domain\UserName"...so essentially string "Text1\Text2" should return as valid. Minor condition is "text1" should have a max length of 8.Thanks.
  • Create New...