c# Programming Glossary: userid
JavaScriptSerializer.Deserialize - how to change field names http://stackoverflow.com/questions/1100191/javascriptserializer-deserialize-how-to-change-field-names is no data in those fields. If I change the JSON data to userid 1234 detaillevel low Then it passes. But I can't change the..
Data type mismatch in criteria expression | Access, OleDb, C# http://stackoverflow.com/questions/1577901/data-type-mismatch-in-criteria-expression-access-oledb-c-sharp C#. My code is public static void UpdateLastLogin int userid DateTime logintime logintime DateTime.Now string sql @ UPDATE..
Color different parts of a RichTextBox string http://stackoverflow.com/questions/1926264/color-different-parts-of-a-richtextbox-string strings. string temp DateTime.Now.ToShortTimeString userid message Environment.NewLine This is what the message would look.. box.ForeColor And this is how you would use it var userid USER0001 var message Access denied var box new RichTextBox .. Color.Red box.AppendText box.AppendText userid Color.Green box.AppendText box.AppendText message Color.Blue..
encrypt SQL connectionstring c# http://stackoverflow.com/questions/2160515/encrypt-sql-connectionstring-c-sharp to a sql 2005 server. In my sourcecode the password and userid for this sql server is coded plain text in ConnectionString...
How to convert c# generic list to json using json.net? http://stackoverflow.com/questions/3482261/how-to-convert-c-sharp-generic-list-to-json-using-json-net Sample of json format should be like this Table userid 1 name xavyTechnologies designation phone 9999999999 email test@test.com.. email test@test.com role Admin empId reportingto userid 2 name chendurpandian designation softwaredeveloper phone 9566643707.. role Super User empId 1 reportingto xavyTechnologies userid 3 name sabarinathan designation marketer phone 66666666666 email..
Can't instantiate a COM object written in C# from VBA (VB6 ok) http://stackoverflow.com/questions/375457/cant-instantiate-a-com-object-written-in-c-sharp-from-vba-vb6-ok public class TestComClass public void Init string userid string password MessageBox.Show string.Format 0 1 userid password.. userid string password MessageBox.Show string.Format 0 1 userid password If I build this and register it on a production machine..
Create HTTP post request and receive response using C# console application http://stackoverflow.com/questions/3892042/create-http-post-request-and-receive-response-using-c-sharp-console-application do that using a C# console application Parameters filename userid password type c# http console response share improve this..
C# WebRequest using Cookies http://stackoverflow.com/questions/4158448/c-sharp-webrequest-using-cookies on chkRememberMe on login form type pwd password pw.Text userid uid.Text username uid.Text string strResponse HttpWebRequest..
how to do subquery in LINQ http://stackoverflow.com/questions/418609/how-to-do-subquery-in-linq if selectedRoles.Length 0 somehow only select the userid from here var subquery from u in CompanyRolesToUsers where..
Login to the page with HttpWebRequest http://stackoverflow.com/questions/450380/login-to-the-page-with-httpwebrequest document.getElementById var f document.getElementById 'userid' if f if f.value.length 8 alert 'Korisni ko ime treba biti u.. right 4px Korisnik th td input type text size 20 id userid name userid td tr tr th style text align right padding right.. 4px Korisnik th td input type text size 20 id userid name userid td tr tr th style text align right padding right 4px Lozinka..
ASP.NET MVC Cookie Implementation http://stackoverflow.com/questions/6797350/asp-net-mvc-cookie-implementation myCookie if session is null actually id userid 0 if userId 0 CookieHelper myCookie new Cookie _app if myCookie..
How to fill forms and submit with Webclient in C# http://stackoverflow.com/questions/793755/how-to-fill-forms-and-submit-with-webclient-in-c-sharp var encoding new ASCIIEncoding var postData userid strId postData username strName byte data encoding.GetBytes..
Entity Framework Stored Procedure Table Value Parameter http://stackoverflow.com/questions/8157345/entity-framework-stored-procedure-table-value-parameter SqlDbType.Int caseId.Value 1 var userId new SqlParameter userid SqlDbType.UniqueIdentifier userId.Value Guid.Parse 846454D9.. parameters string command EXEC storeProcName @caseid @userid @warnings context.ExecuteStoreCommand command parameters and..
Refactoring code to avoid anti-pattern http://stackoverflow.com/questions/11224170/refactoring-code-to-avoid-anti-pattern bankFact public void FreezeAllAccountsForUser int userId IEnumerable RepositoryLayer.BankAccount accountsForUser accountRepository.FindAll.. accountRepository.FindAll p p.BankUser.UserID userId foreach RepositoryLayer.BankAccount repositroyAccount in accountsForUser..
Polymorphism: Is ORM entity a Domain Entity or Data Entity? http://stackoverflow.com/questions/11257484/polymorphism-is-orm-entity-a-domain-entity-or-data-entity bankFact public void FreezeAllAccountsForUser int userId IEnumerable RepositoryLayer.BankAccount accountsForUser accountRepository.FindAll.. accountRepository.FindAll p p.BankUser.UserID userId foreach RepositoryLayer.BankAccount oneOfRepositoryAccounts..
Unit Testing without Database: Linq to SQL http://stackoverflow.com/questions/11348691/unit-testing-without-database-linq-to-sql objects. CODE public void FreezeAllAccountsForUser int userId List DTOLayer.BankAccountDTOForStatus bankAccountDTOList new.. accounts AccountRepository.GetAllAccountsForUser userId foreach DBML_Project.BankAccount acc in accounts string typeResult.. fast tests. public void FreezeAllAccountsForUser int userId ILijosBankRepository accountRepository your code as before test..
LDAP Authentication in ASP.Net MVC http://stackoverflow.com/questions/1401667/ldap-authentication-in-asp-net-mvc ASP.Net MVC application allows the user to register a userId and password and then log in. I dont want the user to be able.. however he should be able to enter his windows domain userId and password and be authenticated by the domain server. The..
SQL Query slow in .NET application but instantaneous in SQL Server Management Studio http://stackoverflow.com/questions/2736638/sql-query-slow-in-net-application-but-instantaneous-in-sql-server-management-st cmd.Parameters.Add @UserID1 SqlDbType.Int .Value userId cmd.Parameters.Add @TrustAccountID2 SqlDbType.Int .Value trustAccountId.. cmd.Parameters.Add @UserID2 SqlDbType.Int .Value userId cmd.Parameters.Add @TrustAccountLogDate2 SqlDbType.DateTime..
How to convert a structure to a byte array in C#? http://stackoverflow.com/questions/3278827/how-to-convert-a-structure-to-a-byte-array-in-c public ushort treeId public ushort processId public ushort userId public ushort multiplexId Trans request public byte wordCount..
ASP.NET MVC Cookie Implementation http://stackoverflow.com/questions/6797350/asp-net-mvc-cookie-implementation CookieName if myCookie null int userId Convert.ToInt32 myCookie.Values UserId User user session.Get.. myCookie.Values UserId User user session.Get User userId return user return null if session is null I try to get from.. in browser. What is wrong I always start session but with userId 0 To get cookie and set session from cookie if userId 0 MyCookie..
Entity Framework Stored Procedure Table Value Parameter http://stackoverflow.com/questions/8157345/entity-framework-stored-procedure-table-value-parameter new SqlParameter caseid SqlDbType.Int caseId.Value 1 var userId new SqlParameter userid SqlDbType.UniqueIdentifier userId.Value.. userId new SqlParameter userid SqlDbType.UniqueIdentifier userId.Value Guid.Parse 846454D9 DE72 4EF4 ABE2 16EC3710EA0F var warnings.. entities.ExecuteStoreProcedure usp_RaiseWarnings_rs userId warnings caseId public static class ObjectContextExt public..
How do I use Assert to verify that an exception has been thrown? http://stackoverflow.com/questions/933613/how-do-i-use-assert-to-verify-that-an-exception-has-been-thrown TestMethod ExpectedException typeof ArgumentException A userId of null was inappropriately allowed. public void NullUserIdInConstructor..
JavaScriptSerializer.Deserialize - how to change field names http://stackoverflow.com/questions/1100191/javascriptserializer-deserialize-how-to-change-field-names public class DataObject XmlElement user_id public int UserId get set XmlElement detail_level public DetailLevel DetailLevel.. dataObject.DetailLevel Assert.AreEqual 1234 dataObject.UserId And the last two asserts fail since there is no data in those.. public class DataObject DataMember Name user_id public int UserId get set DataMember Name detail_level public string DetailLevel..
Soft Delete Entity Framework Code First http://stackoverflow.com/questions/12698793/soft-delete-entity-framework-code-first any with IsDeleted So if I said _db.Users.FirstOrDefault UserId id if that user had IsDeleted true it would ignore it. Essentially..
how to do subquery in LINQ http://stackoverflow.com/questions/418609/how-to-do-subquery-in-linq WHERE Users.lastname LIKE ' fra ' AND Users.Id IN SELECT UserId FROM CompanyRolesToUsers WHERE CompanyRoleId in 2 3 4 There.. where u.RoleID in selectedRoles select u.UserId somehow transform this into an Expression var subExpression.. IdsToFind.Contains crtu.CompanyRoleId .Select crtu crtu.UserId .Contains u.Id Regarding this portion of the question predicateAnd..
EF4 Code First: how to add a relationship without adding a navigation property http://stackoverflow.com/questions/5217441/ef4-code-first-how-to-add-a-relationship-without-adding-a-navigation-property one many for simplicity . public class User public string UserId get set public string PasswordHash get set public bool IsDisabled.. classes would look like. public class User public string UserId get set public string PasswordHash get set public bool IsDisabled.. you will be able to map it public class User public string UserId get set public string PasswordHash get set public bool IsDisabled..
How to get last inserted id? http://stackoverflow.com/questions/5228780/how-to-get-last-inserted-id this code string insertSql INSERT INTO aspnet_GameProfiles UserId GameId VALUES @UserId @GameId using SqlConnection myConnection.. INSERT INTO aspnet_GameProfiles UserId GameId VALUES @UserId @GameId using SqlConnection myConnection new SqlConnection myConnectionString.. insertSql myConnection myCommand.Parameters.AddWithValue @UserId newUserId myCommand.Parameters.AddWithValue @GameId newGameId..
EF 4.1 - Code First - JSON Circular Reference Serialization Error http://stackoverflow.com/questions/5588143/ef-4-1-code-first-json-circular-reference-serialization-error Status get set User public class User Key public int UserId get set public string Login get set public string FirstName..
When is it better to store flags as a bitmask rather than using an associative table? http://stackoverflow.com/questions/5708239/when-is-it-better-to-store-flags-as-a-bitmask-rather-than-using-an-associative-t Option 2 be better Option 1 Use an associative table. User UserId PK Name Department Permission PermissionId PK Name User_Permission.. Department Permission PermissionId PK Name User_Permission UserId FK PermissionId FK Option 2 Store a bitmask for each user. User.. FK Option 2 Store a bitmask for each user. User UserId PK Name Department Permissions Flags enum Permissions Read 1..
ServiceStack.Net Redis: Storing Related Objects vs. Related Object Ids http://stackoverflow.com/questions/8914349/servicestack-net-redis-storing-related-objects-vs-related-object-ids public class Feed public long Id get set public long UserId get set public User GetUser return repository.GetUser UserId.. get set public User GetUser return repository.GetUser UserId Which of the above approaches will work best I've seen both.. Users Questions and Users Answers is stored in idx user q UserId QuestionId1 QuestionId2 etc idx user a UserId AnswerId1 AnswerId2..
database login prompt with crystal reports http://stackoverflow.com/questions/1132314/database-login-prompt-with-crystal-reports .ToString UsuarioBD ConfigurationSettings.AppSettings UserID .ToString this.crtReportes.ReportSource this.prepareReport public.. crConnectionInfo.DatabaseName NombreBD crConnectionInfo.UserID UsuarioBD crConnectionInfo.Password Clave foreach CrystalDecisions.CrystalReports.Engine.Table..
AutoMapper: Mapping between a IDataReader and DTO object http://stackoverflow.com/questions/1973351/automapper-mapping-between-a-idatareader-and-dto-object private System.Boolean _IsActive DataFieldMapping UserID DataObjectFieldAttribute true true false NotNullOrEmpty Message.. true true false NotNullOrEmpty Message UserID From Users Table Is Required. public override int Id get return..
Deserializing JSON data to C# using JSON.NET http://stackoverflow.com/questions/2546138/deserializing-json-data-to-c-sharp-using-json-net MyAccount JsonProperty PropertyName username public string UserID get set JsonProperty PropertyName givenname public string GivenName..
Using Linq to group a list of objects into a new grouped list of list of objects http://stackoverflow.com/questions/2697253/using-linq-to-group-a-list-of-objects-into-a-new-grouped-list-of-list-of-objects here goes... I have an object public class User public int UserID get set public string UserName get set public int GroupID get.. List User userList new List User userList.Add new User UserID 1 UserName UserOne GroupID 1 userList.Add new User UserID 2.. UserID 1 UserName UserOne GroupID 1 userList.Add new User UserID 2 UserName UserTwo GroupID 1 userList.Add new User UserID 3..
Unable to rename file with ftp methods when current user directory is different from root http://stackoverflow.com/questions/3035610/unable-to-rename-file-with-ftp-methods-when-current-user-directory-is-different string newFilename FTPSettings.IP DOMAIN NAME FTPSettings.UserID USER ID FTPSettings.Password PASSWORD FtpWebRequest reqFTP null.. true reqFTP.Credentials new NetworkCredential FTPSettings.UserID FTPSettings.Password FtpWebResponse response FtpWebResponse.. public static string IP get set public static string UserID get set public static string Password get set share improve..
How to implement badges? http://stackoverflow.com/questions/3162446/how-to-implement-badges In the database you simply store a collection of BadgeID UserID pairs to track who has what and a count or a rowID to allow..
How to serialize/deserialize simple classes to XML and back http://stackoverflow.com/questions/3356976/how-to-serialize-deserialize-simple-classes-to-xml-and-back ShoppingCart public List CartItem Items get set public int UserID get set public class CartItem public int SkuID get set public..
Entity Framework: Setting a Foreign Key Property http://stackoverflow.com/questions/480872/entity-framework-setting-a-foreign-key-property a table that looks roughly like this CREATE TABLE Lockers UserID int NOT NULL PRIMARY KEY foreign key LockerStyleID int foreign.. as parameters. So we'd like to do this Locker l new Locker UserID userID LockerStyleID lockerStyleID NameplateID nameplateID entities.AddLocker..
DataGrid get selected rows' column values http://stackoverflow.com/questions/5121186/datagrid-get-selected-rows-column-values DataGrid.Columns DataGridTextColumn Binding Binding Path UserID Header User ID Width SizeToHeader DataGridTextColumn Binding.. to access the data through doing something like rowData.UserID but I cannot seem to work it out. There are lots of tutorials..
WCF Authentication with custom ClientCredentials: What is the clientCredentialType to use? http://stackoverflow.com/questions/563037/wcf-authentication-with-custom-clientcredentials-what-is-the-clientcredentialty added to service calls to pass around additional info e.g UserID etc. If you'd like any more info on this I can post further..
“Invalid attempt to call Read when reader is closed” error (for lengthy operations only) http://stackoverflow.com/questions/6775136/invalid-attempt-to-call-read-when-reader-is-closed-error-for-lengthy-operatio DateTime.Now db.AddInParameter cmd userID DbType.Int32 UserID db.AddOutParameter cmd CountOfUnchangedZipCode DbType.String..
AutoMapper (Or Similar) - Allow Mapping of Dynamic types? http://stackoverflow.com/questions/7778216/automapper-or-similar-allow-mapping-of-dynamic-types it does not work. dynamic CurUser _users.GetSingleUser UserID var retUser Mapper.DynamicMap UserModel CurUser _users.GetSingleUser.. Mapper.DynamicMap UserModel CurUser _users.GetSingleUser UserID Returns a dynamic Object. c# automapper massive share improve.. null return entity dynamic CurUser _users.GetSingleUser UserID var retUser DynamicToStatic.ToStatic UserModel CurUser share..
facebook c# sdk getting started http://stackoverflow.com/questions/8720023/facebook-c-sharp-sdk-getting-started and click Debug and it should list your applicationID UserID and for expires it should say never . Once you have this access..
Get Stored Procedure from Data Context : Linq to SQl http://stackoverflow.com/questions/11310996/get-stored-procedure-from-data-context-linq-to-sql List DBML_Project.BankAccount GetAllAccountsForUser int userID void UpdateBankAccountUsingStoredProcedure public class LijosSimpleBankRepository.. List DBML_Project.BankAccount GetAllAccountsForUser int userID IQueryable DBML_Project.BankAccount queryResultEntities Context.GetTable.. DBML_Project.BankAccount .Where p p.AccountOwnerID userID return queryResultEntities.ToList public virtual void UpdateBankAccountUsingStoredProcedure..
Unit Testing without Database: Linq to SQL http://stackoverflow.com/questions/11348691/unit-testing-without-database-linq-to-sql List DBML_Project.BankAccount GetAllAccountsForUser int userID void Update public class LijosSimpleBankRepository ILijosBankRepository.. List DBML_Project.BankAccount GetAllAccountsForUser int userID IQueryable DBML_Project.BankAccount queryResultEntities Context.GetTable.. DBML_Project.BankAccount .Where p p.AccountOwnerID userID return queryResultEntities.ToList public virtual void Update..
Loading Subrecords in the Repository Pattern http://stackoverflow.com/questions/1223194/loading-subrecords-in-the-repository-pattern should look more like userRepository.FindRolesByUserId int userID userRepository.AddUserToRole int userID userRepository.FindAllUsers.. int userID userRepository.AddUserToRole int userID userRepository.FindAllUsers userRepository.FindAllRoles userRepository.GetUserSettings.. userRepository.GetUserSettings int userID etc... These are specific operations that your application wants..
Signing SOAP messages using X.509 certificate from WCF service to Java webservice http://stackoverflow.com/questions/4666970/signing-soap-messages-using-x-509-certificate-from-wcf-service-to-java-webservic webservice.rbs.emea.ps.entrust.com types UserException userID 0061020051 userID ns2 createUser S Body S Envelope WCF web service.. types UserException userID 0061020051 userID ns2 createUser S Body S Envelope WCF web service I have one..
Entity Framework: Setting a Foreign Key Property http://stackoverflow.com/questions/480872/entity-framework-setting-a-foreign-key-property So we'd like to do this Locker l new Locker UserID userID LockerStyleID lockerStyleID NameplateID nameplateID entities.AddLocker.. new System.Data.EntityKey entities.User ID userID locker.LockerStyleReference.EntityKey new EntityKey entities.LockerStyle..
“Invalid attempt to call Read when reader is closed” error (for lengthy operations only) http://stackoverflow.com/questions/6775136/invalid-attempt-to-call-read-when-reader-is-closed-error-for-lengthy-operatio DbType.DateTime DateTime.Now db.AddInParameter cmd userID DbType.Int32 UserID db.AddOutParameter cmd CountOfUnchangedZipCode..
The cast to value type 'Int32' failed because the materialized value is null http://stackoverflow.com/questions/6864311/the-cast-to-value-type-int32-failed-because-the-materialized-value-is-null on u.ID equals ch.UserID where u.ID userID select ch.Amount .Sum How can I modify the query to accept.. on u.ID equals ch.UserID where u.ID userID select int ch.Amount .Sum 0 This first casts to int to tell..
Entity Framework DbContext SaveChanges() OriginalValue Incorrect http://stackoverflow.com/questions/9588352/entity-framework-dbcontext-savechanges-originalvalue-incorrect Entries that are modified public int SaveChanges string userID Have tried both with and without the following line and received.. them foreach AuditLog log in GetAuditRecordsForChange ent userID this.AuditLog.Add log return base.SaveChanges The problem.. GetAuditRecordsForChange DbEntityEntry dbEntry string userID if dbEntry.State System.Data.EntityState.Modified foreach..
|