Search Results

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

Page 22/55 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • How to access and work with XML from API in C#

    - by Jarek
    My goal is to pull XML data from the API and load it to a sql server database. The frist step I'm attempting here is to access the data and display it. Once I get this to work I'll loop through each row and insert the values into a sql server database. When I try to run the code below nothing happens and when I paste the url directly into the browser I get this error "2010-03-08 04:24:17 Wallet exhausted: retry after 2010-03-08 05:23:58. 2010-03-08 05:23:58" To me it seems that every iteration of the foreach loop makes a call to the site and I get blocked for an hour. Am I retrieving data from the API in an incorrect manner? Is there some way to load the data into memory or an array then loop through that? Here's the bit of code I hacked together. using System; using System.Data.SqlClient; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml; using System.Data; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { string userID = "123"; string apiKey = "abc456"; string characterID = "789"; string url = "http://api.eve-online.com/char/WalletTransactions.xml.aspx?userID=" + userID + "&apiKey=" + apiKey + "&characterID=" + characterID; XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(url); XmlNamespaceManager xnm1 = new XmlNamespaceManager(xmldoc.NameTable); XmlNodeList nList1 = xmldoc.SelectNodes("result/rowset/row", xnm1); foreach (XmlNode xNode in nList1) { Response.Write(xNode.InnerXml + "<br />"); } } catch (SqlException em) { Response.Write(em.Message); } } } Here's a sample of the xml <eveapi version="2"> <currentTime>2010-03-06 17:38:35</currentTime> <result> <rowset name="transactions" key="transactionID" columns="transactionDateTime,transactionID,quantity,typeName,typeID,price,clientID,clientName,stationID,stationName,transactionType,transactionFor"> <row transactionDateTime="2010-03-06 17:16:00" transactionID="1343566007" quantity="1" typeName="Co-Processor II" typeID="3888" price="1122999.00" clientID="1404318579" clientName="unseenstrike" stationID="60011572" stationName="Osmeden IX - Moon 6 - University of Caille School" transactionType="sell" transactionFor="personal" /> <row transactionDateTime="2010-03-06 17:15:00" transactionID="1343565894" quantity="1" typeName="Co-Processor II" typeID="3888" price="1150000.00" clientID="1404318579" clientName="unseenstrike" stationID="60011572" stationName="Osmeden IX - Moon 6 - University of Caille School" transactionType="sell" transactionFor="personal" /> </rowset> </result> <cachedUntil>2010-03-06 17:53:35</cachedUntil> </eveapi>

    Read the article

  • NHibernate session management in ASP.NET MVC

    - by Kevin Pang
    I am currently playing around with the HybridSessionBuilder class found on Jeffrey Palermo's blog post: http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/ Using this class, my repository looks like this: public class UserRepository : IUserRepository { private readonly ISessionBuilder _sessionBuilder; public UserRepository(ISessionBuilder sessionBuilder) { _sessionBuilder = sessionBuilder; } public User GetByID(string userID) { using (ISession session = _sessionBuilder.GetSession()) { return session.Get<User>(userID); } } } Is this the best way to go about managing the NHibernate session / factory? I've heard things about Unit of Work and creating a session per web request and flushing it at the end. From what I can tell, my current implementation isn't doing any of this. It is basically relying on the Repository to grab the session from the session factory and use it to run the queries. Are there any pitfalls to doing database access this way?

    Read the article

  • complicated sql query !!

    - by user507779
    LookupTable: userid, mobileid, startedate, enddate , owner 1 , 1 , 12-12-2000, 01-01-2001, asd 2 , 2 , 12-12-2000, 01-01-2001, dgs 3 , 3 , 02-01-2001, 01-01-2002, sdg 4 , 4 , 12-12-2000, 01-01-2001, sdg UserInfoTable: userid, firstname, lastname, address 1 , tom , do , test 2 , sam , smith , asds 3 , john , saw , asdasda 4 , peter , winston , near by Mobile: Mobileid, Name , number, imeinumber 1 , apple , 123 , 1111111 2 , nokia , 456 , 2222222 3 , vodafone , 789 , 3333333 CallLogs: id , Mobileid, callednumbers (string), date , totalduration 1 , 1 , 123,123,321 , 13-12-2000 , 30 2 , 1 , 123,123,321 , 14-12-2000 , 30 3 , 2 , 123,123,321 , 13-12-2000 , 30 4 , 2 , 123,123,321 , 14-12-2000 , 30 5 , 3 , 123,123,321 , 13-12-2000 , 30 6 , 3 , 123,123,321 , 14-12-2000 , 30 1 , 1 , 123,123,321 , 13-01-2002 , 30 2 , 1 , 123,123,321 , 14-01-2002 , 30 I want a query which will return me the following: firstname, lastname, mobile.name as mobilename, callednumbers (as concatinated strings from different rows in CallLogs table) and need it for year 2000 example: firstname, lastname, mobilename, callednumbers tom , do , apple , 123,123,321, 123,123,321 sam , smith , nokia , 123,123,321, 123,123,321 peter , winston , apple , 123,123,321, 123,123,321 any help will be highly appreciated...

    Read the article

  • Connection Strings between Web Application and SQL Server

    - by Raven Dreamer
    Greetings. I'm writing a web application that is supposed to connect to a SQL Server database; the connection is formed from the following database string: <add key="DatabaseConnectionString" value="server=DEVPC1\SQLEXPRESS;uid=USERID;pwd=PASSWORD;database=DATABASE"/> However, whenever I try and run the web application, I get a connection error, specifically: An error occurred attempting this login: Login failed for user 'USERID'. Any suggestions on how to go about debugging this? I'm not really familiar with SQL, so any suggestions would be greatly appreciated.

    Read the article

  • Type casting in TPC inheritance

    - by Mohsen Esmailpour
    I have several products like HotelProduct, FlightProduct ... which derived from BaseProduct class. The table of these products will be generated in TPC manner in database. There is OrderLine class which has a BaseProduct. My problem is when i select an OrderLine with related product i don't know how cast BaseProduct to derived product. for example i have this query: var order = (from odr in _context.Orders join orderLine in _context.OrderLines on odr.Id equals orderLine.OrderId join hotel in _context.Products.OfType<HotelProduct>() on orderLine.ProductId equals hotel.Id where odr.UserId == userId && odr.Id == orderId orderby odr.OrderDate descending select odr).SingleOrDefault(); In OrderLine i have BaseProduct properties not properties of HotelProduct. Is there any way to cast BaseProduct to derived class in OrderLine or any other solutions ?

    Read the article

  • UPDATE and INSERT differences in syntax is an inconvenience

    - by theband
    I was going through this article today. http://vinothbabu.com/2010/05/08/update-and-insert-differences-in-syntax-is-an-inconvenience/ I was not able to understand this part of the code written by the author. list($sets,$cols,$values)=escape_arr($sets); $insert_sql=”INSERT INTO `avatars` “.implode(’,',$cols).” VALUES(”.implode(’,',$values).”)”; $update_sql=”UPDATE `avatars` SET “.implode(’,',$sets).” WHERE userid=$userid LIMIT 1?; and finally the conclusion part of the article.

    Read the article

  • ASP.net application advice needed

    - by c11ada
    hey all, im biulding a ASP.net application, which is connected to a database. the database design is as follows **Users Table** UserID `(PK) autonumber` Username **Question Table** QuestionID `(PK) autonumber` QuestionNumber QuestionText **Questionnaire Table** QuestionnaireID `(PK) autonumber` UserID `(FK) User Table` Date **Feedback Table** FeedbackID `(PK) autonumber` QuestionnaireID `(FK) Questionnaire Table` QuestionID `(FK) Questions Table` Answer Comment please can some one advise me on how I should go about inserting data into the questionnaire table and the feedback table. I know that the questionnaire table needs to be updated first. but the Questionnaire ID is linked to the feedback table, so how do I go about updating both tables ?

    Read the article

  • T-SQL: How Do I Create A "Private" Function Inside A Stored Procedure

    - by RPM1984
    Okay so im writing a SQL Server 2008 Stored Procedure (maintenance script). In doing so, being a good boy i've done plenty of error handling, checking rowcounts, printing output messages, etc But in doing this, ive found myself writing over and over again something like this: SELECT @RowsAffected = @@ROWCOUNT IF @RowsAffected > 0 BEGIN PRINT CAST(@RowsAffected, NVARCHAR(2)) + 'rows updated.' END Or debug messages like this: PRINT 'User ' + CAST(@UserId AS NVARCHAR(5)) + ' modified successfully' Is there a way i can create a kind of 'subroutine' inside the stored procedure (like a private method) that can accept something as a parameter (doesnt have to though) and do some logic? I want to be able to do something like this: CheckRowCounts Or this: PrintUserUpatedMessage(@UserId) Which would then perform the above logic (check rowcount, print message, etc) And yes obviously i can create a UDF, but then i would need to create/drop it etc as this logic is only required for the life of the execution of this stored procedure. Getting sick and tired of writing the same code over and over again, and changing all the different areas ive used it when i get an error =) Can anyone help?

    Read the article

  • Do i need to insert one fake row in database ?

    - by Ankit Rathod
    Hello, I have few tables like example. Users Books UsersBookPurchase UID BookId UserId UName Name BookId Password Price Email This is fine. I am having my own login system but i am also using some 3rd party to validate like OpenID or facebook Authetication. My question is if the user is able to log in successfully using OpenID or facebook Authentication, what steps do i need to do i.e do i have to insert one fake row in Users table because if i do not insert how will integrity be maintained. I mean what user id should i insert in UsersBookPurchase when the person who has logged in using Facebook Authentication has made a purchase because the UserId is reference key from Users table. Please give me a high level overview of what i need to do because this is fairly common scenario. Thanks in advance :)

    Read the article

  • JQUERY Loop from a AJAX Response

    - by nobosh
    I'm building a tagger. After a user submits a tag, ajax returns: {"returnmessage":"The Ajax operation was successful.","tagsinserted":"BLAH, BLOOOW","returncode":"0"} I want to take the tagsinserted and loop through it, and during each loop take the item in the list and insert it on the HTML page. suggestion on how to do this right? Here is the current code: $("#tag-post").click(function(){ // Post $('#tag-input').val() $.ajax({ url: '/tags/ajax/post-tag/', data: { newtaginput : $('#tag-input').val(), userid : $('#userid').val()}, success: function(data) { // After posting alert('done'); } }); });

    Read the article

  • Documents/links on preventing HTML form fiddling?

    - by larryq
    Hi everyone, I'm using ASP.Net but my question is a little more general than that. I'm interested in reading about strategies to prevent users from fooling with their HTML form values and links in an attempt to update records that don't belong to them. For instance, if my application dealt with used cars and had links to add/remove inventory, which included as part of the URL the userid, what can I do to intercept attempts to munge the link and put someone else's ID in there? In this limited instance I can always run a check at the server to ensure that userid XYZ actually has rights to car ABC, but I was curious what other strategies are out there to keep the clever at bay. (Doing a checksum of the page, perhaps? Not sure.) Thanks for your input.

    Read the article

  • How to get the answers version and use it in IF loop

    - by sai
    delimiter // DROP PROCEDURE `getData`// CREATE DEFINER=`root`@`localhost` PROCEDURE `getData`(IN templateName VARCHAR(45),IN templateVersion VARCHAR(45),IN userId VARCHAR(45)) BEGIN set @version = CONCAT("SELECT `saveOEMsData_answersVersion` FROM `saveOEMsData` WHERE `saveOEMsData_templateName` = '",templateName,"' AND `saveOEMsData_templateVersion` = ",templateVersion," AND `saveOEMsData_userId`= ",userId); PREPARE s1 from @version; EXECUTE S1; END // delimiter ; I am retreiving saveOEMsData_answersVersion, but I have to use it in an IF loop, as in if the version == 1, then I would use a query, else I would use something else. But I am not able to use the version. Could someone help with this?? I am only able to print but not able to use the version.

    Read the article

  • one primary key column foreign key to 2 other table columns.How to resolve data entry issue.

    - by Rohit
    I have a requirement according to which I have to create a central Login system.We have 2 things Corporate and Brand each represented by tables "Corporate" and "Brand". When a corporate gets registered,corporateID is given,When a user under that corporate gets registered there is a table corporateuser in which corporateID is a foreign key and CorporateUserID is a primary key.Similarly in the case of a brand. So we have CorporateUserId and BrandUserID. Now i have a table called RegisteredUsers in which i want to have corporate as well as brand users.UserID is a primary key in this table which is a foreign key to both corporateuser as well as Branduser. now when i enter a corporateuser,I do an entry to corporateuser as well as RegisteredUsers.When i enter CorporateUserID in userID for RegisteredUsers.It gives foreign key violation error. I fully understand this error.How can i achieve this.This requirement is very rigid.Please tell a workaround

    Read the article

  • c# linq to sql join problem

    - by b0x0rz
    i am trying to do using (UserManagementDataContext context = new UserManagementDataContext()) { var users = from u in context.Users where u.UserEMailAdresses.EMailAddress == "[email protected]" select u; return users.Count(); } however, when i get to: using (UserManagementDataContext context = new UserManagementDataContext()) { var users = from u in context.Users where u.UserEMailAdresses. i do not get offered the EMailAddress name, but rather some neutral default-looking list of options in intelisense. what am i doing wrong? table Users ID bigint NameTitle nvarchar(64) NameFirst nvarchar(64) NameMiddle nvarchar(64) NameLast nvarchar(64) NameSuffix nvarchar(64) Status bigint IsActive bit table UserEMailAddresses ID bigint UserID bigint EMailAddress nvarchar(256) IsPrimary bit IsActive bit obviously, 1 user can have many addresses and so Users.ID and UserEMailAddresses.UserID have a relationship between them: 1 to MANY.

    Read the article

  • Comet with ASP.NET AsyncHttpHandlers

    - by Sumit
    I am implementing a comet using AsyncHttpHandlers in my current asp.net application. According to my implementation client initially sends Notification Hook request to server (with its user id) on AsyncHttpHandler, and on server side I maintain a Global (Application level) dictionary of userid(key) and IAynsResult (value). So when ever a request is received to send notification to a user I just pick the matching IAsyncResult from the Global Dictionary and send response to the client user. My concern is, is maintaing a Dictionary of Userid and IAsyncResult at Application level a good design? I feel it will put a lot of load on the server, at the time of high traffic. Is there any other way I can achieve the comet. or what will be the good design to achieve comet for high traffic scenarios.

    Read the article

  • Filter by virtual column?

    - by user329957
    I have the following database structure : [Order] OrderId Total [Payment] OrderId Amount Every Order can have X payment rows. I want to get only the list of orders where the sum of all the payments are < than the order Total. I have the following SQL but I will return all the orders paid and unpaid. SELECT o.OrderId, o.UserId, o.Total, o.DateCreated, COALESCE(SUM(p.Amount),0) AS Paid FROM [Order] o LEFT JOIN Payment p ON p.OrderId = o.OrderId GROUP BY o.OrderId, o.Total, o.UserId, o.DateCreated I have tried to add Where (Paid < o.Total) but it does not work, any idea? BTM I'm using SQL CE 3.5

    Read the article

  • Inserting data using Linq

    - by Ani
    I have a linq query to insert data in table. but its not working. I saw some example on internet tried to do like that but doesn't seems to work. Tablename: login has 3 columns userid, username and password. I set userid as autoincrementing in database. So I have to insert only username and password everytime.Here's my code. linq_testDataContext db = new linq_testDataContext(); login insert = new login(); insert.username = userNameString; insert.Password = pwdString; db.logins.Attach(insert);// tried to use Add but my intellisence is not showing me Add.I saw attach but dosent seems to work. db.SubmitChanges();

    Read the article

  • How to save array of integer numbers in a column in SQL Server 2005

    - by hamed
    I have a table in SQL Server 2005 with the following properties: Users (UserID, Username, Password) where UserID is primary key I want to save an array of integer numbers in the password attribute in the Users table. -------------------- 0 1 2 3 -------------------- 1543 6543 7658 8765 -------------------- I plan to save this into the password column. On the other hand I use pictures instead of texts for password and each picture has a code (4 digit) and a password include 4 picture that produce 16 digit. I want to save these 16 digits (array of Ints) into the Password column please help me. thanks

    Read the article

  • Json return code to simplify if possible.

    - by pirzada
    Can you simplify this code?. Is there anything we can do to make it more simple. I am not sure but it looks ugly to me. [HttpPost] public JsonResult UserDetailById(int userId, string username) { IQueryable<Company> repository = companyRepository.GetGridCompanies(); Employee emp = companyRepository.GetEmployee(userId); //Drop down fill var a = (from c in repository .OrderBy(c => c.companyName) select new { Id = c.companyID, Name = c.companyName }).ToArray(); var data = new { Id = emp.companyID.ToString(), Name = emp.employeeFirstname + " " + emp.employeeLastname, Fn = emp.employeeFirstname, Ln = emp.employeeLastname, Dept = emp.employeeDepartment, Sup = emp.employeeSup.ToString(), HireDate = String.Format("{0:MM/dd/yyyy}", emp.employeeHiredate), CompVm = a }; return Json(data); }

    Read the article

  • Correct model for a database with a table for each user.

    - by BAH
    Kinda stuck here... I have an application with lets say 5000 rows of data per user and was wondering if it was right or wrong to do it this way: On user account creation a new table is created (UserData_[UserID]) or should I just have 1 table for userdata and have everything in there with a column for userid? The reason I am stuck at the moment is that it seems NHibernate isn't able to be mapped to dynamic table names without creating another ISessionFactory which has alot of overhead AFAIK. Any help would be greatly appreciated. Thanks.

    Read the article

  • Having problem in sql query execution

    - by Rishi2686
    Hi there, I have a problem in sql query execution.I am using this sql query: $userid = 1; $sql = mysql_query(" SELECT ID, Nm, Address, date_format(DateOfBirth, '%d%M%Y') as DateOfBirth FROM PersonalDetails where UserMasterID = $userid ") or die (mysql_error()); The result appears as: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= ' at line 1 When I execute this in PHPMyAdmin it works properly. I am using mysql(5.0.5b) and PHP (5.2.6) Can you help me please?

    Read the article

  • MySQL Delete from 1 table, using multiple tables

    - by nute
    I would like to delete all the rows found by that query: SELECT cart_abandon.* FROM cart_abandon, cart_product, txn_product, users WHERE cart_abandon.cartid = cart_product.cartid AND cart_product.productid = txn_product.productid AND txn_product.username = users.username AND users.id = cart_abandon.userid AND txn_product.txndate >= cart_abandon.abandondate The thing to keep in mind is that the query here uses 4 different tables, however I only want to delete rows from 1 table (cart_abandon). Is there an easy way to do that? Maybe this: ? DELETE cart_abandon FROM cart_abandon, cart_product, txn_product, users WHERE cart_abandon.cartid = cart_product.cartid AND cart_product.productid = txn_product.productid AND txn_product.username = users.username AND users.id = cart_abandon.userid AND txn_product.txndate >= cart_abandon.abandondate Is that valid? Correct?

    Read the article

  • SQL Server Delete - Froregin Key

    - by Ahmet Altun
    I have got two tables in Sql Server 2005: USER Table: information about user and so on. COUNTRY Table : Holds list of whole countries on the world. USER_COUNTRY Table: Which matches, which user has visited which county. It holds, UserID and CountryID. For example, USER_COUNTRY table looks like this: ID -- UserID -- CountryID 1 -- 1 -- 34 2 -- 1 -- 5 3 -- 2 -- 17 4 -- 2 -- 12 5 -- 2 -- 21 6 -- 3 -- 19 My question is that: When a user is deleted in USER table, how can I make associated records in USER_COUNTRY table deleted directly. Maybe, by using Foreign Key Constaint?

    Read the article

  • How to manually verify a user against the asp.net memberhip database

    - by Ekk
    I would like to know how I can verify a user's credential against an existing asp.net membership database. The short story is that we want provide single sign on access. So what I've done is to connect directly to the membership database and tried to run a sql query against the aspnet_Membership table: private bool CanLogin(string userName, string password) { // Check DB to see if the credential is correct try { string passwordHash = FormsAuthentication.HashPasswordForStoringInConfigFile(password, "SHA1"); string sql = string.Format("select 1 from aspnet_Users a inner join aspnet_Membership b on a.UserId = b.UserId and a.applicationid = b.applicationid where a.username = '{0}' and b.password='{1}'", userName.ToLowerInvariant(), passwordHash); using (SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString)) using (SqlCommand sqlCmd = new SqlCommand(sql, sqlConn)) { sqlConn.Open(); int count = sqlCmd.ExecuteNonQuery(); sqlConn.Close(); return count == 1; } } catch (Exception ex) { return false; } } The problem is the password value, does anyone know how the password it is hashed?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >