Search Results

Search found 1372 results on 55 pages for 'userid'.

Page 5/55 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Cannot return view model after POST

    - by Interfector
    HI, I am trying to return a model after a POST but I receive the following error: Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object. Line 29: public UsersModel getUser(Int32 id) { Line 30: return ( Line 31: from users in db.NUsers Line 32: join userSettings in db.NUsersSettings The code in the controller looks like this: [AcceptVerbs( HttpVerbs.Post )] public ActionResult Edit( NUsers user ) { //Other code that doesn't affect the error :) UsersModel userDetails = this.usersObj.getUser( user.UserID ); return View( userDetails ); } The getUser method looks like this: public UsersModel getUser(Int32 id) { return ( from users in db.NUsers join userSettings in db.NUsersSettings on users.UserID equals userSettings.UserID where users.UserID == id select new UsersModel { UserId = Convert.ToInt32( users.UserID ), Email = Convert.ToString( users.Email ), FirstName = Convert.ToString( users.FirstName ), LastName = Convert.ToString( users.LastName ), Language = Convert.ToString( userSettings.Language ), Phone = Convert.ToString( users.Phone ) } ).First(); } and finally the UsersModel if you think it is relevant: public class UsersModel { public int UserId; public string Email; public string FirstName; public string LastName; public string Language; public string Phone; public List<NLanguages> Languages; public UsersModel() { Models.Languages languagesObj = new Models.Languages(); Languages = languagesObj.getLanguages(); } } Any thoughts on what might be causing the error and what can I do to fix it? Thx

    Read the article

  • Facebook Connect - Using both FBML and PHP Client

    - by Ryan
    I am doing my second Facebook connect site. On my first site, I used the facebook coonect FBML to sign a user in, then I could access other information via the PHP Client. With this site, using the same exact code, it doesn't seem to be working. I'd like someone to be able to sign in using the Facebook button: <fb:login-button length="long" size="medium" onlogin="facebook_onlogin();"></fb:login-button> After they have logged in, the facebook_onlogin() function makes some AJAX requests to a PHP page which attempts to use the Facebook PHP Client. Here's the code from that page: $facebook = new Facebook('xxxxx API KEY xxxxx', 'xxxxx SECRET KEY xxxxx'); //$facebook->require_login(); ** I DONT WANT THIS LINE!! $userID = $facebook->api_client->users_getLoggedInUser(); if($userID) { $user_details = $facebook->api_client->users_getInfo($userID, 'last_name, first_name'); $firstName = $user_details[0]['first_name']; $lastName = $user_details[0]['last_name']; $this->view->userID = $userID; $this->view->firstName = $firstName; $this->view->lastName = $lastName; } The problem is that the PHP Client thinks I don't have a session key, so the $userID never get set. If I override the $userID with my facebook ID (which I am logged in with) I get this error: exception 'FacebookRestClientException' with message 'A session key is required for calling this method' in C:\wamp\www\mab\application\Facebook\facebookapi_php5_restlib.php:3003 If I uncomment the require_login(), it will get a session ID, but it redirects pages around a lot and breaks my AJAX calls. I am using the same code I successfully did this with on another site. Anyone have any ideas why the PHP client don't know about the session ID after a user has logged in with the connect button? Any ideas would be greatly appreciated. Thanks!

    Read the article

  • Nhibernat mapping aspnet_Users table

    - by Michael D. Kirkpatrick
    My User table I want to map to aspnet_Users: <class name="User" table="`User`"> <id name="ID" column="ID" type="Int32" unsaved-value="0"> <generator class="native" /> </id> <property name="UserId" column="UserId" type="Guid" not-null="true" /> <property name="FullName" column="FullName" type="String" not-null="true" /> <property name="PhoneNumber" column="PhoneNumber" type="String" not-null="false" /> </class> My aspnet_Users table: <class name="aspnet_Users" table="aspnet_Users"> <id name="ID" column="UserId" type="Guid" /> <property name="UserName" column="UserName" type="string" not-null="false" /> </class> I tried adding one-to-one, one-to-many and many-to-one mappings. The closest I can get is with this error: Object of type 'System.Guid' cannot be converted to type 'System.Int32'. How do I create a 1 way mapping from User to aspnet_User via the UserId column in User? I am only wanting to create a reference so I can extract read-only information, affect sorts, etc. I still need to leave UserId column in User set up like it is now. Maybe a virtual reference keying off of UserId? Is this even possible with Nhibernate? Unfortunately it acts like it only wants to use ID from User to map to aspnet_Users. Changing the table User to have it's primary key be UserId instead of ID is not an option at this point. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • Should my validator have access to my entire model?

    - by wb
    As the title states I'm wondering if it's a good idea for my validation class to have access to all properties from my model. Ideally, I would like to do that because some fields require 10+ other fields to verify whether it is valid or not. I could but would rather not have functions with 10+ parameters. Or would that make the model and validator too coupled with one another? Here is a little example of what I mean. This code however does not work because it give an infinite loop! Class User Private m_UserID Private m_Validator Public Sub Class_Initialize() End Sub Public Property Let Validator(value) Set m_Validator = value m_Validator.Initialize(Me) End Property Public Property Get Validator() Validator = m_Validator End Property Public Property Let UserID(value) m_UserID = value End property Public Property Get UserID() UserID = m_Validator.IsUserIDValid() End property End Class Class Validator Private m_User Public Sub Class_Initialize() End Sub Public Sub Initialize(value) Set m_User = value End Sub Public Function IsUserIDValid() IsUserIDValid = m_User.UserID > 13 End Function End Class Dim mike : Set mike = New User mike.UserID = 123456 mike.Validator = New Validator Response.Write mike.UserID If I'm right and it is a good idea, how can I go a head and fix the infinite loop with the get property UserID? Thank you.

    Read the article

  • hibernate insert to a collection causes a delete then all the items in the collection to be inserted

    - by Mark
    I have a many to may relationship CohortGroup and Employee. Any time I insert an Employee into the CohortGroup hibernate deletes the group from the resolution table and inserts all the members again, plus the new one. Why not just add the new one? The annotation in the Group: @ManyToMany(cascade = { PERSIST, MERGE, REFRESH }) @JoinTable(name="MYSITE_RES_COHORT_GROUP_STAFF", joinColumns={@JoinColumn(name="COHORT_GROUPID")}, inverseJoinColumns={@JoinColumn(name="USERID")}) public List<Employee> getMembers(){ return members; } The other side in the Employee @ManyToMany(mappedBy="members",cascade = { PERSIST, MERGE, REFRESH } ) public List<CohortGroup> getMemberGroups(){ return memberGroups; } Code snipit Employee emp = edao.findByID(cohortId); CohortGroup group = cgdao.findByID(Long.decode(groupId)); group.getMembers().add(emp); cgdao.persist(group); below is the sql reported in the log delete from swas.MYSITE_RES_COHORT_GROUP_STAFF where COHORT_GROUPID=? insert into swas.MYSITE_RES_COHORT_GROUP_STAFF (COHORT_GROUPID, USERID) values (?, ?) insert into swas.MYSITE_RES_COHORT_GROUP_STAFF (COHORT_GROUPID, USERID) values (?, ?) insert into swas.MYSITE_RES_COHORT_GROUP_STAFF (COHORT_GROUPID, USERID) values (?, ?) insert into swas.MYSITE_RES_COHORT_GROUP_STAFF (COHORT_GROUPID, USERID) values (?, ?) insert into swas.MYSITE_RES_COHORT_GROUP_STAFF (COHORT_GROUPID, USERID) values (?, ?) insert into swas.MYSITE_RES_COHORT_GROUP_STAFF (COHORT_GROUPID, USERID) values (?, ?) This seams really inefficient and is causing some issues. If sevral requests are made to add an employee to the group then some get over written.

    Read the article

  • Why is my long polling code for a notification system not updating in real time? PHP MYSQL

    - by tjones
    I am making a notification system similar to the red notification on facebook. It should update the number of messages sent to a user in real time. When the message MYSQL table is updated, it should instantly notify the user, but it does not. There does not seem to be an error inserting into MYSQL because on page refresh the notifications update just fine. I am essentially using code from this video tutorial: http://www.screenr.com/SNH (which updates in realtime if a data.txt file is changed, but it is not written for MYSQL like I am trying to do) Is there something wrong with the below code: **Javascript** <script type="text/javascript"> $(document).ready(function(){ var timestamp = null; function waitForMsg(){ $.ajax({ type: "GET", url: "getData.php", data: "userid=" + userid, async: true, cache: false, success: function(data){ var json = eval('(' + data + ')'); if (json['msg'] != "") { $('.notification').fadeIn().html(json['msg']); } setTimeout('waitForMsg()',30000); }, error: function(XMLHttpRequest, textStatus, errorThrown){ setTimeout('waitForMsg()',30000); } }); } waitForMsg(); </script> <body> <div class="notification"></div> **PHP*** <?php if ($_SERVER['REQUEST_METHOD'] == 'GET' ) { $userid = $_GET['userid']; include("config.php"); $sql="SELECT MAX(time) FROM notification WHERE userid='$userid'"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $currentmodif = $row['MAX(time)']; $s="SELECT MAX(lasttimeread) FROM notificationsRead WHERE submittedby='$userid'"; $r = mysql_query($s); $rows = mysql_fetch_assoc($r); $lasttimeread = $rows['MAX(lasttimeread)']; while ($currentmodif <= $lasttimeread) { usleep(10000); clearstatcache(); $currentmodif = $row['MAX(time)']; } $response = array(); $response['msg'] = You have new messages; echo json_encode($response); } ?>

    Read the article

  • jQuery AJAX type: 'GET', passing value problem.

    - by Trez
    I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:"userId=12345&userName=test"}, success:function(data){ alert('successful'); } ); In my console output is: GET:http://sample.com/createUser?userId=12345&userName=test params: userId 12345 userName test In my script i should get the value using $_GET['userId'] and $_GET['userName'] but i can't get the value passed in by ajax request using GET method. Any ideas on how to do this? thanks,

    Read the article

  • SQL Server: How to call a UDF, if available?

    - by Ian Boyd
    Most systems will have a user-defined function (UDF) available. Some will not. i want to use the UDF if it's there: SELECT Users.*, dbo.UserGroupMembershipNames(Users.UserID) AS MemberOfGroupNames FROM Users Otherwise fallback to the acceptable alternative SELECT Users.*, (SELECT TOP 1 thing FROM Something WHERE Something.ID = Users.UserID) AS MemberGroupNames FROM Users How do? My first attempt, using the obvious solution, of course failed: SELECT Users.*, CASE WHEN (OBJECT_ID('dbo.UserGroupMembershipNames') IS NOT NULL) THEN dbo.UserGroupMembershipNames(Users.UserID) ELSE (SELECT TOP 1 thing FROM Something WHERE Something.ID = Users.UserID) END AS MemberOfGroupNames FROM Users for reasons beyond me

    Read the article

  • mysql multi count() in one query

    - by atno
    Hi, I'm trying to count several joined tables but without any luck, what I get is the same numbers for every column (tUsers,tLists,tItems). My query is: select COUNT(users.*) as tUsers, COUNT(lists.*) as tLists, COUNT(items.*) as tItems, companyName from users as c join lists as l on c.userID = l.userID join items as i on c.userID = i.userID group by companyID The result I want to get is --------------------------------------------- # | CompanyName | tUsers | tlists | tItems 1 | RealCoName | 5 | 2 | 15 --------------------------------------------- what modifications do i have to do to my query to get those results? Cheers

    Read the article

  • Foreign Keys in SQLITE in the Google Gears framework

    - by Maxim Gershkovich
    Hi all, Could someone please tell me why the following foreign key constraint (although executes fine) is not enforced by SQLITE? Could someone pleasse provide an example of how I can go about enforcing the relationship? CREATE TABLE User (UserID TEXT Unique NOT NULL PRIMARY KEY, FirstName TEXT NOT NULL, LastName TEXT NOT NULL, Username TEXT NOT NULL, Password TEXT NOT NULL, Email TEXT NOT NULL, SignupDate TEXT NOT NULL) CREATE TABLE Category (CategoryID TEXT Unique NOT NULL PRIMARY KEY, UserID TEXT, FOREIGN KEY(UserID) REFERENCES User(UserID))

    Read the article

  • Cannot add or update a child row: a foreign key constraint fails

    - by Tom
    table 1 +----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+----------------+ | UserID | int(11) | NO | PRI | NULL | auto_increment | | Password | varchar(20) | NO | | | | | Username | varchar(25) | NO | | | | | Email | varchar(60) | NO | | | | +----------+-------------+------+-----+---------+----------------+ table2 +------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+----------------+ | UserID | int(11) | NO | MUL | | | | PostID | int(11) | NO | PRI | NULL | auto_increment | | Title | varchar(50) | NO | | | | | Summary | varchar(500) | NO | | | | +------------------+--------------+------+-----+---------+----------------+ com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (myapp/table2, CONSTRAINT table2_ibfk_1 FOREIGN KEY (UserID) REFERENCES table1 (UserID)) What have I done wrong? I read this: http://www.w3schools.com/Sql/sql_foreignkey.asp and i don't see whats wrong. :S

    Read the article

  • Which is more efficient in mysql, a big join or multiple queries of single table?

    - by Tom Greenpoint
    I have a mysql database like this Post – 500,000 rows (Postid,Userid) Photo – 200,000 rows (Photoid,Postid) About 50,000 posts have photos, average 4 each, most posts do not have photos. I need to get a feed of all posts with photos for a userid, average 50 posts each. Which approach would be more efficient? 1: Big Join select * from post left join photo on post.postid=photo.postid where post.userid=123 2: Multiple queries select * from post where userid=123 while (loop through rows) { select * from photo where postid=row[postid] }

    Read the article

  • How do you find out what element type the root element is with jquery

    - by user363873
    I'm sending an ajax request that will either give me an error or a userID <?xml version="1.0" encoding="UTF-8"?> <error>1000</error> <?xml version="1.0" encoding="UTF-8"?> <userID>8</userID> how can I find out if the root element is error or userID using jquery or just javascript in general. Using the find method doesn't appear to work if what you're trying to access is the root element

    Read the article

  • Solving Slow Query

    - by Chris
    We are installing a new forum (yaf) for our site. One of the stored procedures is extremely slow - in fact it always times out in the browser. If I run it in MSSMS it takes nearly 10 minutes to complete. Is there a way to find out what part of this query if taking so long? The Query: DECLARE @BoardID int DECLARE @UserID int DECLARE @CategoryID int = null DECLARE @ParentID int = null SET @BoardID = 1 SET @UserID = 2 select a.CategoryID, Category = a.Name, ForumID = b.ForumID, Forum = b.Name, Description, Topics = [dbo].[yaf_forum_topics](b.ForumID), Posts = [dbo].[yaf_forum_posts](b.ForumID), Subforums = [dbo].[yaf_forum_subforums](b.ForumID, @UserID), LastPosted = t.LastPosted, LastMessageID = t.LastMessageID, LastUserID = t.LastUserID, LastUser = IsNull(t.LastUserName,(select Name from [dbo].[yaf_User] x where x.UserID=t.LastUserID)), LastTopicID = t.TopicID, LastTopicName = t.Topic, b.Flags, Viewing = (select count(1) from [dbo].[yaf_Active] x JOIN [dbo].[yaf_User] usr ON x.UserID = usr.UserID where x.ForumID=b.ForumID AND usr.IsActiveExcluded = 0), b.RemoteURL, x.ReadAccess from [dbo].[yaf_Category] a join [dbo].[yaf_Forum] b on b.CategoryID=a.CategoryID join [dbo].[yaf_vaccess] x on x.ForumID=b.ForumID left outer join [dbo].[yaf_Topic] t ON t.TopicID = [dbo].[yaf_forum_lasttopic](b.ForumID,@UserID,b.LastTopicID,b.LastPosted) where a.BoardID = @BoardID and ((b.Flags & 2)=0 or x.ReadAccess<>0) and (@CategoryID is null or a.CategoryID=@CategoryID) and ((@ParentID is null and b.ParentID is null) or b.ParentID=@ParentID) and x.UserID = @UserID order by a.SortOrder, b.SortOrder IO Statistics: Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_Active'. Scan count 14, logical reads 28, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_User'. Scan count 0, logical reads 3, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_Topic'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_Category'. Scan count 0, logical reads 28, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_Forum'. Scan count 0, logical reads 488, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_UserGroup'. Scan count 231, logical reads 693, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_ForumAccess'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_AccessMask'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'yaf_UserForum'. Scan count 1, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. Client Statistics: Client Execution Time 11:54:01 Query Profile Statistics Number of INSERT, DELETE and UPDATE statements 0 0.0000 Rows affected by INSERT, DELETE, or UPDATE statements 0 0.0000 Number of SELECT statements 8 8.0000 Rows returned by SELECT statements 19 19.0000 Number of transactions 0 0.0000 Network Statistics Number of server roundtrips 3 3.0000 TDS packets sent from client 3 3.0000 TDS packets received from server 34 34.0000 Bytes sent from client 3166 3166.0000 Bytes received from server 128802 128802.0000 Time Statistics Client processing time 156478 156478.0000 Total execution time 572009 572009.0000 Wait time on server replies 415531 415531.0000 Execution Plan

    Read the article

  • Add User to Database not working

    - by user1850189
    I'm really new to ASP.net and I am currently trying to create a registration page on a site. I was successful in adding a user to the database but I decided to add another feature into the code to check what userID's were available. For example, if a user deleted their account their userID would become available for use again. I'm trying to find the min value and the max value and add or subtract 1 depending on whether it is min or max. I can run the code I have written for this with no errors but the user is not added to the database. Can anyone help me figure out what I'm missing from my code to do this? EDIT Code adds a user to database but it adds the new user at -1 instead. I don't seem to be able to see where the issue is. If (aDataReader2.Read() = False) Then aConnection1 = New OleDbConnection(aConnectionString) aConnection1.Open() aQuery = "Insert Into UserDetails " aQuery = aQuery & "Values ('" & userID & "','" & userFName & "','" & userLName & "','" & userEmail & "','" & userUsername & "','" & userPassword & "')" aCommand = New OleDbCommand(aQuery, aConnection1) aCommand.ExecuteNonQuery() aConnection1.Close() ElseIf (min = 1) Then aConnection2 = New OleDbConnection(aConnectionString) aConnection2.Open() aCommand = New OleDbCommand(aQuery3, aConnection2) aDataReader2 = aCommand.ExecuteReader() userID = max + 1 aQuery = "Insert Into UserDetails " aQuery = aQuery & "Values ('" & userID & "','" & userFName & "','" & userLName & "','" & userEmail & "','" & userUsername & "','" & userPassword & "')" aCommand = New OleDbCommand(aQuery, aConnection2) aCommand.ExecuteNonQuery() aConnection2.Close() Else aConnection3 = New OleDbConnection(aConnectionString) aConnection3.Open() aCommand = New OleDbCommand(aQuery2, aConnection3) aDataReader2 = aCommand.ExecuteReader userID = min - 1 aQuery = "Insert Into UserDetails " aQuery = aQuery & "Values ('" & userID & "','" & userFName & "','" & userLName & "','" & userEmail & "','" & userUsername & "','" & userPassword & "')" aCommand = New OleDbCommand(aQuery, aConnection3) aCommand.ExecuteNonQuery() aConnection3.Close() lblResults.Text = "User Account successfully created" btnCreateUser.Enabled = False End If Here's the code I used to get the max and min values from the database. I'm getting a value of 0 for both of them - when min should be 1 and max should be 5 Dim minID As Integer Dim maxID As Integer aQuery2 = "Select Min(UserID) AS '" & [minID] & "' From UserDetails" aQuery3 = "Select Max(UserID) AS ' " & [maxID] & "' From UserDetails"

    Read the article

  • WCF- Large Data

    - by Pinu
    I have a WCF Web Service with basicHTTPBinding , the server side the transfer mode is streamedRequest as the client will be sending us large file in the form of memory stream. But on client side when i use transfer mode as streamedRequest its giving me a this errro "The remote server returned an error: (400) Bad Request" And when i look in to trace information , i see this as the error message Exception: There is a problem with the XML that was received from the network. See inner exception for more details. InnerException: The body of the message cannot be read because it is empty. I am able to send up to 5MB of data using trasfermode as buffered , but it will effect the performance of my web service in the long run , if there are many clients who are trying to access the service in buffered transfer mode. SmartConnect.Service1Client Serv = new SmartConnectClient.SmartConnect.Service1Client(); SmartConnect.OrderCertMailResponse OrderCert = new SmartConnectClient.SmartConnect.OrderCertMailResponse(); OrderCert.UserID = "abcd"; OrderCert.Password = "7a80f6623"; OrderCert.SoftwareKey = "90af1"; string applicationDirectory = @"\\inid\utty\Bran"; byte[] CertMail = File.ReadAllBytes(applicationDirectory + @"\5mb_test.zip"); MemoryStream str = new MemoryStream(CertMail); //OrderCert.Color = true; //OrderCert.Duplex = false; //OrderCert.FirstClass = true; //OrderCert.File = str; //OrderCert.ReturnAddress1 = "Test123"; //OrderCert.ReturnAddress2 = "Test123"; //OrderCert.ReturnAddress3 = "Test123"; //OrderCert.ReturnAddress4 = "Test123"; OrderCert.File = str; //string OrderNumber = ""; //string Password = OrderCert.Password; //int ReturnCode = 0; //string ReturnMessage = ""; //string SoftwareKey = OrderCert.SoftwareKey; //string UserID = OrderCert.UserID; //OrderCert.File = str; MemoryStream FileStr = str; Serv.OrderCertMail(OrderCert); // Serv.OrderCertMail(ref OrderNumber, ref Password, ref ReturnCode, ref ReturnMessage, ref SoftwareKey, ref UserID, ref FileStr ); lblON.Text = OrderCert.OrderNumber; Serv.Close(); // My Web Service - Service Contract [OperationContract] OrderCertMailResponse OrderCertMail(OrderCertMailResponse OrderCertMail); [MessageContract] public class OrderCertMailResponse { string userID = ""; string password = ""; string softwareID = ""; MemoryStream file = null; //MemoryStream str = null; [MessageHeader] //[DataMember] public string UserID { get { return userID; } set { userID = value; } } [MessageHeader] //[DataMember] public string Password { get { return password; } set { password = value; } } [MessageHeader] //[DataMember] public string SoftwareKey { get { return softwareID; } set { softwareID = value; } } [MessageBodyMember] // [DataMember] public MemoryStream File { get { return file; } set { file = value; } } [MessageHeader] //[DataMember] public string ReturnMessage; [MessageHeader] //[DataMember] public int ReturnCode; [MessageHeader] public string OrderNumber; //// Control file fields //[MessageHeader] ////[DataMember] //public string ReturnAddress1; //[MessageHeader] ////[DataMember] //public string ReturnAddress2; //[MessageHeader] ////[DataMember] //public string ReturnAddress3; //[MessageHeader] ////[DataMember] //public string ReturnAddress4; //[MessageHeader] ////[DataMember] //public bool FirstClass; //[MessageHeader] ////[DataMember] //public bool Color; //[MessageHeader] ////[DataMember] //public bool Duplex; } [ServiceBehavior(IncludeExceptionDetailInFaults = true)] public class Service1 : IService1 { public OrderCertMailResponse OrderCertMail(OrderCertMailResponse OrderCertMail) { OrderService CertOrder = new OrderService(); ClientUserInfo Info = new ClientUserInfo(); ControlFileInfo Control = new ControlFileInfo(); //Info.Password = "f2496623"; // hard coded password for development testing purposes //Info.SoftwareKey = "6dbb71"; // hard coded software key this is a developement software key //Info.UserName = "sdfs"; // hard coded UserID - for testing Info.UserName = OrderCertMail.UserID.ToString(); Info.Password = OrderCertMail.Password.ToString(); Info.SoftwareKey = OrderCertMail.SoftwareKey.ToString(); //Control.ReturnAddress1 = OrderCertMail.ReturnAddress1; //Control.ReturnAddress2 = OrderCertMail.ReturnAddress2; //Control.ReturnAddress3 = OrderCertMail.ReturnAddress3; //Control.ReturnAddress4 = OrderCertMail.ReturnAddress4; //Control.CertMailFirstClass = OrderCertMail.FirstClass; //Control.CertMailColor = OrderCertMail.Color; //Control.CertMailDuplex = OrderCertMail.Duplex; //byte[] CertFile = new byte[0]; //byte[] CertFile = null; //string applicationDirectory = @"\\intrepid\utility\Bryan"; // byte[] CertMailFile = File.ReadAllBytes(applicationDirectory + @"\3mb_test.zip"); //MemoryStream str = new MemoryStream(CertMailFile); OrderCertMailResponseClass OrderCertResponse = CertOrder.OrderCertmail(Info,Control,OrderCertMail.File); OrderCertMail.ReturnMessage = OrderCertResponse.ReturnMessage.ToString(); OrderCertMail.ReturnCode = Convert.ToInt32(OrderCertResponse.ReturnCode.ToString()); OrderCertMail.OrderNumber = OrderCertResponse.OrderNumber; return OrderCertMail; }

    Read the article

  • Grails / GORM, read-only cache and transient fields

    - by Stephen Swensen
    Suppose I have the following Domain object mapping to a legacy table, utilizing read-only second-level cache, and having a transient field: class DomainObject { static def transients = ['userId'] Long id Long userId static mapping = { cache usage: 'read-only' table 'SOME_TABLE' } } I have a problem, references to DomainObject instances seem to be shared due to the caching, and thus transient fields are writing over each other. For example, def r1 = DomainObject.get(1) r1.userId = 22 def r2 = DomainObject.get(1) r2.userId = 34 assert r1.userId == 34 That is, r1 and r2 are references to the same instance. This is undesirable, I would like to cache the table data without sharing references. Any ideas?

    Read the article

  • Unable to compare valuesfrom mysql in a prepared statement

    - by Cortopasta
    I can't seem to get this to connect to the database so that I can run my prepared statement. Does anybody have an idea what I've forgotten? private function check_credentials($plain_username, $password) { global $dbcon; $ac = new ac(); $ac->dbconnect(); $userid = $dbcon->prepare('SELECT id FROM users WHERE username = :username AND password = :password LIMIT 1'); $userid->bindParam(':username', $plain_username); $userid->bindParam(':password', $password); $userid->execute(); $id = $userid->fetch(); Return $id; } EDIT: I changed the SQL query from a SELECT FROM query, to an INSERT INTO query and it worked. WHat the heck is going on?

    Read the article

  • Additional/Optional query string parameters in URI Template in WCF

    - by Rajesh Kumar
    I have written a simple REST Service in WCF in which I have created 2 method using same URI Template but with different Method(POST and GET). For GET method I am also sending additional query parameters as follows: [WebInvoke(Method = "POST", UriTemplate = "users")] [OperationContract] public bool CreateUserAccount(User user) { //do something return restult; } [WebGet(UriTemplate = "users?userid={userid}&username={userName}")] [OperationContract] public User GetUser(int userid, string userName) { // if User ID then // Get User By UserID //else if User Name then // Get User By User Name //if no paramter then do something } when I call CreateUserAccount with method POST it is working fine but when I call GetUser method using GET and sending only one query string parameter(userID or UserName) it is giving error "HTTP Method not allowed" but if send both parameters its wokrs fine. Can anyone help me?

    Read the article

  • Facebook Developer Toolkit doesn't redirect after authorization

    - by Mika Kolari
    I have a small facebook test app (iframe) based on sample http://blogs.claritycon.com/blogs/kevin_marshall/archive/2009/10/06/facebook-developer-toolkit-3-0-asp-net-mvc-sample.aspx public class HomeController : Controller { public ActionResult Index() { var api = this.GetApi(); var userId = api.Session.UserId; return View(); } // redirects to Index // which doesn't redirect back here [FacebookAuthorization(IsFbml = false)] public ActionResult About() { var api = this.GetApi(); // goes here without FacebookAuthorization // but userId = 0 var userId = api.Session.UserId; return View(); } } When I try to go to 'About' page, FacebookAuthorizationAttribute redirects to 'Index' for authentication. The problem is, it never redirects back to 'About'. What am I doing wrong here?

    Read the article

  • how to effectively modify index

    - by daedlus
    Hej everyone, problem : I am looking for right way to convert an index from clustered to non-clustered Description : I have a table as below in sybase db: dbo.UserLog Id | UserId |time | .... This is hash partitioned using UserId. Currently it has 2 indexes UserId : non-clustered time: clustered This table has about 20 million records. I now want to make UserId as clustered index and time as non-clustered index. is it correct to user alter index to change from clustered to non-clustered or do i drop index and recreate. does the fact that userId is used in hash partitioning have any implications to this? To me alter seems way to go but I have not yet tried this.

    Read the article

  • SQL query: Delete a entry which is not present in a join table?

    - by Mestika
    Hi, I’m going to delete all users which has no subscription but I seem to run into problems each time I try to detect the users. My schemas look like this: Users = {userid, name} Subscriptionoffering = {userid, subscriptionname} Now, what I’m going to do is to delete all users in the user table there has a count of zero in the subscriptionoffering table. Or said in other words: All users which userid is not present in the subscriptionoffering table. I’ve tried with different queries but with no result. I’ve tried to say where user.userid <> subscriptionoffering.userid, but that doesn’t seem to work. Do anyone know how to create the correct query? Thanks Mestika

    Read the article

  • how to prune data set?

    - by sakura90
    The MovieLens data set provides a table with columns: userid | movieid | tag | timestamp I have trouble reproducing the way they pruned the MovieLens data set used in: http://www.cse.ust.hk/~yzhen/papers/tagicofi-recsys09-zhen.pdf In 4.1 Data Set of the above paper, it writes "For the tagging information, we only keep those tags which are added on at least 3 distinct movies. As for the users, we only keep those users who used at least 3 distinct tags in their tagging history. For movies, we only keep those movies that are annotated by at least 3 distinct tags." I tried to query the database: select TMP.userid, count(*) as tagnum from (select distinct T.userid as userid, T.tag as tag from tags T) AS TMP group by TMP.userid having tagnum = 3; I got a list of 1760 users who labeled 3 distinct tags. However, some of the tags are not added on at least 3 distinct movies. Any help is appreciated.

    Read the article

  • Grails / GORM, Disable First-level Cache

    - by Stephen Swensen
    Suppose I have the following Domain class mapping to a legacy table, utilizing read-only second-level cache, and having a transient field: class DomainObject { static def transients = ['userId'] Long id Long userId static mapping = { cache usage: 'read-only' table 'SOME_TABLE' } } I have a problem, references to DomainObject are being shared due to first-level caching, and thus transient fields are writing over each other. For example, def r1 = DomainObject.get(1) r1.userId = 22 def r2 = DomainObject.get(1) r2.userId = 34 assert r1.userId == 34 That is, r1 and r2 are references to the same instance. This is undesirable, I would like to cache the table data without sharing references. Any ideas? [Edit] Understanding the situation better now, I believe my question boils down to the following: Is there anyway to disable first level cache for a specific domain class while still using second level cache?

    Read the article

  • linq to sql using foreign keys returning iqueryable(of myEntity]

    - by Gern Blandston
    I'm trying to use Linq to SQL to return an IQueryable(of Project) when using foreign key relationships. Using the below schema, I want to be able to pass in a UserId and get all the projects created for the company the user is associated with. DB tables: Projects Projid ProjCreator FK (UserId from UserInfo table) Companyid FK (CompanyID from Companies table) UserInfo UserID PK Companyid FK Companies CompanyId PK Description I can get the iqueryable(of project) when simply getting the ProjectCreator with this: Return (From p In db.Projects _ Where p.ProjectCreator = Me.UserId) But I'm having trouble getting the syntax to get a iqueryable(of projects) when using foreign keys. Below gives me an IQueryable(of anonymous) but I can't seem to convince it to give me an IQueryable(of project) even if I try to cast it: Dim retval = (From p In db.Projects _ Join c In db.Companies On p.CompanyId Equals c.CompanyId _ Join u In db.UserInfos On u.CompanyId Equals c.CompanyId _ Where u.Login = UserId)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >