Search Results

Search found 11 results on 1 pages for 'tempid'.

Page 1/1 | 1 

  • Get nodes value one by one in xslt

    - by Audy
    I am using XSl file in which I am reading values from xml node and creating another xml file. Following is the part of input xml from which I want to read value node one by one. Input Xml: <RoomsInvs> <RoomInv> <ProvisionalId Id="13-0000000007">13-0000000007</ProvisionalId> </RoomInv> <RoomInv> <ProvisionalId Id="13-0000000008">13-0000000008</ProvisionalId> </RoomInv> </RoomsInvs> Xsl Applied: <values> <xsl:apply-templates select="//RoomsInvs/RoomInv" /> </values> <xsl:template match="RoomInv" > <tempID> <xsl:value-of select="ProvisionalId[position()]"/> </tempID> </xsl:template> Output Getting: <values> <tempID>13-0000000007</tempID> <tempID>13-0000000007</tempID> </values> Output I want: <values> <tempID>13-0000000007</tempID> <tempID>13-0000000008</tempID> </values>

    Read the article

  • T-SQL While Loop and concatenation

    - by JustinT
    I have a SQL query that is supposed to pull out a record and concat each to a string, then output that string. The important part of the query is below. DECLARE @counter int; SET @counter = 1; DECLARE @tempID varchar(50); SET @tempID = ''; DECLARE @tempCat varchar(255); SET @tempCat = ''; DECLARE @tempCatString varchar(5000); SET @tempCatString = ''; WHILE @counter <= @tempCount BEGIN SET @tempID = ( SELECT [Val] FROM #vals WHERE [ID] = @counter); SET @tempCat = (SELECT [Description] FROM [Categories] WHERE [ID] = @tempID); print @tempCat; SET @tempCatString = @tempCatString + '<br/>' + @tempCat; SET @counter = @counter + 1; END When the script runs, @tempCatString outputs as null while @tempCat always outputs correctly. Is there some reason that concatenation won't work inside a While loop? That seems wrong, since incrementing @counter works perfectly. So is there something else I'm missing?

    Read the article

  • how to insert data field in a table is empty

    - by banita
    Hi iam making an application in vb as front end and backend as oracle . I want autogenerated id on click of new button.it works well if data is present in table but show error if the table is empty . What i need to insert so that it work when iam first time using the appliction . my button code is as Private Sub cmd_new_Click() Call txt_clear txt_name.Enabled = True Set rsCat = New ADODB.Recordset rsCat.Open "Category", conn, adOpenDynamic, adLockPessimistic If rsCat.EOF = rscat.BOF Then tempId = 1000 Else rsCat.MoveLast tempId = rsCat.Fields("Category_Id") + 1 End If txt_Id = tempId cmd_Save.Enabled = True cmd_new = False End Sub

    Read the article

  • nextSibling issue, again... sorry...

    - by SoLoGHoST
    Ok, I am using insertRow to insert a TR element into a table, but for some reason it doesn't count that inserted TR element as a sibling of the others when I do nextSibling on it. For example, consider the following table. <table id="myTable"> <tr id="row_0"> <td colspan="3">Row 1</td> </tr> <tr id="tr_0_0"> <td>Option 1</td> <td>Option2</td> <td>Option 3</td> </tr> <tr id="tr_0_1"> <td>Option 1</td> <td>Option 2</td> <td>Option 3</td> </tr> </table> So after I do this: var lTable = document.getElementById("myTable"); var trEle = lTable.insertRow(-1); trEle.id = "tr_0_2"; var cell1 = trEle.insertCell(0); cell1.innerHTML = "Option 1"; var cell2 = trEle.insertCell(1); cell2.innerHTML = "Option 2"; var cell3 = trEle.insertCell(-1); cell3.innerHTML = "Option 3"; Then I use this approach to get all of the siblings, but it NEVER gives me the last sibling in here, but ONLY if it's been added via insertRow, because it gets all nextSiblings just fine, but once I add a sibling via insertRow it never gives me that last Sibling, argggg.... var tempTr = document.getElementById("row_0"); var totalSibs = 0; while(tempTr.nextSibling != null) { var tempId = tempTr.id; // If no id, not an element, or not a tr_0 id. if (!tempId || tempTr.nodeType != 1 || tempId.indexOf("tr_0") != 0) { tempTr = tempTr.nextSibling; continue; } // This NEVER ALERTS the last id of the row that was inserted using insertRow, arggg. alert(tempId); totalSibs++; tempTr = tempTr.nextSibling; } So, totalSibs should return 3 because after I inserted the row, there should be 3 Siblings, but instead returns 2 and never counts the 3rd Sibling.... arggg. Can someone please help me here?? Thank a lot, you guys/gals are Awesome!

    Read the article

  • MySQL stored procedure, handling multiple cursors and query results

    - by Tirithen
    How can I use two cursors in the same routine? If I remove the second cursor declaration and fetch loop everthing works fine. The routine is used for adding a friend in my webapp. It takes the id of the current user and the email of the friend we want to add as a friend, then it checks if the email has a corresponding user id and if no friend relation exists it will create one. Any other routine solution than this one would be great as well. DROP PROCEDURE IF EXISTS addNewFriend; DELIMITER // CREATE PROCEDURE addNewFriend(IN inUserId INT UNSIGNED, IN inFriendEmail VARCHAR(80)) BEGIN DECLARE tempFriendId INT UNSIGNED DEFAULT 0; DECLARE tempId INT UNSIGNED DEFAULT 0; DECLARE done INT DEFAULT 0; DECLARE cur CURSOR FOR SELECT id FROM users WHERE email = inFriendEmail; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur; REPEAT FETCH cur INTO tempFriendId; UNTIL done = 1 END REPEAT; CLOSE cur; DECLARE cur CURSOR FOR SELECT user_id FROM users_friends WHERE user_id = tempFriendId OR friend_id = tempFriendId; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur; REPEAT FETCH cur INTO tempId; UNTIL done = 1 END REPEAT; CLOSE cur; IF tempFriendId != 0 AND tempId != 0 THEN INSERT INTO users_friends (user_id, friend_id) VALUES(inUserId, tempFriendId); END IF; SELECT tempFriendId as friendId; END // DELIMITER ;

    Read the article

  • Authenticate into asp.net app from a winforms app

    - by tempid
    Hi there! We have 2 applications - 1 windows and 1 web (asp.net). Winforms runs on the customer's machine where as the website is hosted within our company. The winforms has a link which opens the web app in a browser window. The web app is secured so the login page is shown. The username and password is the same as the windows app login. How do I auto-login to the web app so the user will not see the login screen? The web app uses FormsAuthentication.SetAuthCookie to create an encrypted cookie on the user's machine. How do I create the same from the winforms app so the user will not see the login screen? Thanks.

    Read the article

  • Update tile notifcation with XML returned by web service

    - by tempid
    I have a Metro app in C# & XAML. The tile is updated periodically and I've used WebAPI to serve the tile notification XML. So far so good. I was then told that I cannot use WebAPI as the server that I was planning to host it on does not have .NET 4.5. No plans to install it anytime soon either. I had to change the WebAPI to a plain old Web service (.NET 3.5) which does the same thing - return tile notification XML. I've enabled HTTP-GET (I know, security concern) and was able to invoke the webservice like this - http://server/TileNotifications.asmx/[email protected] But ever since I made the switch, the tiles are not being updated. I've checked Fiddler and made sure the app is hitting the webservice and the XML is being returned correctly. But the tiles are not updated. If I replace it with the WebAPI, the tiles are updated. Do I need to do anything special with the web services? like decorating the web method with a custom attribute? Here's my web service code - [WebMethod] public XmlDocument GetTileData(string user) { // snip var xml = new XmlDocument(); xml.LoadXml(string.Format(@"<tile> <visual> <binding template='TileWideSmallImageAndText02'> <image id='1' src='http://server/images/{0}_wide.png'/> <text id='1'>Custom Field : {1}/text> <text id='2'>Custom Field : {2}</text> <text id='3'>Custom Field : {3}</text> </binding> <binding template='TileSquarePeekImageAndText01'> <image id='1' src='http://server/images/{0}_square.png'/> <text id='1'>Custom Field</text> <text id='2'>{1}</text> </binding> </visual> </tile>", value1, value2, value3, value4)); return xml; }

    Read the article

  • nextSibling issues...

    - by SoLoGHoST
    Ok, this has been killing me all night, I mean I've been working on this code for atleast 8 hours now. What is the problem with this, argggg. I am trying to update all <span id="column_[some number]"> to increment it by one after the next id="row_" tr element, but for some god knows what reason, it gives me issues. It's updating the same <span> tag 2x, and this changes it from the desired value to 1 more than it should be... argggg. Here's my code someone please help me here... // Reorder all columns, if any, in the other rows after this 1. if (aRowId != 0 && lId.indexOf("tr_" + aRowId) == 0 && rowComplete != aRowId) { var tempTr = lTable.childNodes[i].childNodes[p]; while(tempTr.nodeType == 1 && tempTr.nextSibling != null) { var tempId = tempTr.getAttribute("id"); if (!tempId) continue; if (tempId.indexOf("row_") == 0) { // All done this row, set it to completed! rowComplete = aRowId; break; } if (tempTr.hasChildNodes) { var doneChilds = false; // grab the id where tdcolumn_{aRowId}.indexOf = 0. for (fcTd = 0; fcTd<tempTr.childNodes.length; fcTd++) { if (tempTr.childNodes[fcTd].nodeName == '#text') continue; var tempfcId = tempTr.childNodes[fcTd].getAttribute("id"); if (!tempfcId) continue; if (tempfcId.indexOf("tdcolumn_" + aRowId) != 0) continue; // looping through the children in the <td> element here. if (tempTr.childNodes[fcTd].hasChildNodes) { for (x = tempTr.childNodes[fcTd].childNodes.length-1; x>0; x--) { if (tempTr.childNodes[fcTd].childNodes[x].nodeName == '#text') continue; var tempSpanId = tempTr.childNodes[fcTd].childNodes[x].getAttribute("id"); if (!tempSpanId) continue; if (tempSpanId.indexOf("column_") != 0) continue; // alert(tempSpanId); alert(tempTr.childNodes[fcTd].childNodes[x].nodeName); var tSpanId = new Array(); tSpanId = tempSpanId.split("_"); if (currColumnId == 0) { currColumnId = parseInt(tSpanId[1]); var incCol = currColumnId; } incCol++; // alert("currColumnId = " + currColumnId + "\n\ntSpanId[1] = " + tSpanId[1] + "\n\nincCol = " + incCol); // Set the new Id's and Text, after which we can exit the for loop. tempTr.childNodes[fcTd].childNodes[x].setAttribute("id", "column_" + incCol); tempTr.childNodes[fcTd].childNodes[x].setAttribute("class", "dp_edit_column"); tempTr.childNodes[fcTd].childNodes[x].innerHTML = oColumnText + " " + incCol; // tempTr.childNodes[fcTd].setAttribute("id", "tdcolumn_" + aRowId + "_" + (parseInt(tSpanId[1])+1) + "_" + tSpanId[3]); doneChilds = true; break; } } else continue; if (doneChilds = true) continue; } } else continue; tempTr = tempTr.nextSibling; } } Please help me, thanks.

    Read the article

  • i want to search in sql server with must have parameter in one colunm

    - by sherif4csharp
    hello i am usning c# and ms SQL server 2008 i have table like this id | propertyTypeId | FinishingQualityId | title | Description | features 1 1 2 prop1 propDEsc1 1,3,5,7 2 2 3 prop2 propDEsc2 1,3 3 6 5 prop3 propDEsc3 1 4 5 4 prop4 propDEsc4 3,5 5 4 6 prop5 propDEsc5 5,7 6 4 6 prop6 propDEsc6 and here is my stored code (search in the same table) create stored procdures propertySearch as @Id int = null, @pageSize float , @pageIndex int, @totalpageCount int output, @title nvarchar(150) =null , @propertyTypeid int = null , @finishingqualityid int = null , @features nvarchar(max) = null , -- this parameter send like 1,3 ( for example) begin select row_number () as TempId over( order by id) , id,title,description,propertyTypeId,propertyType.name,finishingQualityId,finishingQuality.Name,freatures into #TempTable from property join propertyType on propertyType.id= property.propertyTypeId join finishingQuality on finishingQuality.id = property.finishingQualityId where property.id = isnull(@id,property.id ) and proprty.PropertyTypeId= isnull(@propertyTypeid,property.propertyTypeId) select totalpageconunt = ((select count(*) from #TempTable )/@pageSize ) select * from #TempTable where tempid between (@pageindex-1)*@pagesize +1 and (@pageindex*@pageSize) end go i can't here filter the table by feature i sent. this table has to many rows i want to add to this stored code to filter data for example when i send 1,3 in features parameter i want to return row number one and two in the example table i write in this post (want to get the data from table must have the feature I send) many thanks for every one helped me and will help

    Read the article

  • PHP Form not working IE and Chrome, but fine in FF

    - by RO
    <? if(isset($_POST['accountUser']) && isset($_POST['accountPassword'])) { include("dbase.php"); include("settings.php"); if ($_POST['accountType']=="member") { $database="chatusers"; } else if ($_POST['accountType']=="model") { $database="chatmodels"; } else if ($_POST['accountType']=="studioop") { $database="chatoperators"; } $userExists=false; $result = mysql_query("SELECT id,user,password,status FROM $database WHERE status!='pending' AND status!='rejected' "); while($row = mysql_fetch_array($result)) { $tempUser=$row["user"]; $tempPass=$row["password"]; $tempId=$row["id"]; if ($_POST['accountUser']==$tempUser && md5($_POST['accountPassword'])==$tempPass) { if ($row["status"]=="blocked") { $userExists=true; $errorMsg="Account is blocked, please contact the administrator for more details"; } else { $userExists=true; $currentTime=time(); mysql_query("UPDATE $database SET lastLogIn='$currentTime' WHERE id = '$tempId' LIMIT 1"); setcookie("usertype", $database, time()+3600); setcookie("id", $tempId, time()+3600); header("Location: cp/$database/"); } } } if (!$userExists){ $errorMsg="Wrong Username or password"; } } else if (isset($_GET['from']) && $_GET['from']=="recoverpass"){ $errorMsg="Your new password has been sent to your mail"; } else { $errorMsg="Please complete username and password fields"; } ?> <? include("_main.header.php"); ?> <table width="720" height="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle"><form action="login.php" method="post" enctype="application/x-www-form-urlencoded" name="form1"> <p>&nbsp;</p> <table width="720" border="0" align="center"> <tr> <td colspan="2"><p align="left"> <span class="error"><?php if ( isset($errorMsg) && $errorMsg!=""){ echo $errorMsg; } ?></span> <br> <br> </p></td> </tr> <tr> <td width="210" align="right" valign="top" class="form_definitions"><div align="right">Username:</div></td> <td align="left" valign="top"><input name="accountUser" type="text" id="accountUser" value="<? echo $_GET[user];?>" size="24" maxlength="24"></td> </tr> <tr> <td align="right" valign="top" class="form_definitions"><div align="right">Password:</div></td> <td align="left" valign="top"><input name="accountPassword" type="password" id="accountPassword2" size="24" maxlength="24"></td> </tr> <tr> <td align="right" valign="top" class="form_definitions"><div align="right">Account type:</div></td> <td align="left" valign="top"> <select name="accountType" id="select"> <option value="member" selected>Member</option> <option value="model">Model</option> <option value="studioop">Studio Operator</option> </select> <div align="left"></div></td> </tr> <tr> <td align="right" valign="top" class="form_definitions">&nbsp;</td> <td align="left" valign="top"> <input type="submit" name="Submit" value="Log In to your account"> <div align="left"></div></td> </tr> <tr> <td align="right" valign="top" class="form_definitions">&nbsp;</td> <td align="left" valign="top"><a href="lostpassword.php" class="left">Lost Password? Press Here!</a></td> </tr> </table> </form></td> </tr> </table> <br> <br> <? include("_main.footer.php"); ?>

    Read the article

  • Getting Error System.Runtime.InteropServices.COMException

    - by Savan Parmar
    Hey All, I am using Vb.Net to Create Labels in Microsoft. For that i am using below mantioend Code. Public Sub CreateLabel(ByVal StrFilter As String, ByVal Path As String) WordApp = CreateObject("Word.Application") ''Add a new document. WordDoc = WordApp.Documents.Add() Dim oConn As SqlConnection = New SqlConnection(connSTR) oConn.Open() Dim oCmd As SqlCommand Dim oDR As SqlDataReader oCmd = New SqlCommand(StrFilter, oConn) oDR = oCmd.ExecuteReader Dim intI As Integer Dim FilePath As String = "" With WordDoc.MailMerge With .Fields Do While oDR.Read For intI = 0 To oDR.FieldCount - 1 .Add(WordApp.Selection.Range, oDR.Item(intI)) Next Loop End With Dim objAutoText As Word.AutoTextEntry = WordApp.NormalTemplate.AutoTextEntries.Add("MyLabelLayout", WordDoc.Content) WordDoc.Content.Delete() .MainDocumentType = Word.WdMailMergeMainDocType.wdMailingLabels FilePath = CreateSource(StrFilter) .OpenDataSource(FilePath) Dim NewLabel As Word.CustomLabel = WordApp.MailingLabel.CustomLabels.Add("MyLabel", False) WordApp.MailingLabel.CreateNewDocument(Name:="MyLabel", Address:="", AutoText:="MyLabelLayout") objAutoText.Delete() .Destination = Word.WdMailMergeDestination.wdSendToNewDocument WordApp.Visible = True .Execute() End With oConn.Close() WordDoc.Close() End Sub Private Function CreateSource(ByVal StrFilter As String) As String Dim CnnUser As SqlConnection = New SqlConnection(connSTR) Dim sw As StreamWriter = File.CreateText("C:\Mail.Txt") Dim Path As String = "C:\Mail.Txt" Dim StrHeader As String = "" Try Dim SelectCMD As SqlCommand = New SqlCommand(StrFilter, CnnUser) Dim oDR As SqlDataReader Dim IntI As Integer SelectCMD.CommandType = CommandType.Text CnnUser.Open() oDR = SelectCMD.ExecuteReader For IntI = 0 To oDR.FieldCount - 1 StrHeader &= oDR.GetName(IntI) & " ," Next StrHeader = Mid(StrHeader, 1, Len(StrHeader) - 2) sw.WriteLine(StrHeader) sw.Flush() sw.Close() StrHeader = "" Do While oDR.Read For IntJ As Integer = 0 To oDR.FieldCount - 1 StrHeader &= oDR.GetString(IntJ) & " ," Next Loop StrHeader = Mid(StrHeader, 1, Len(StrHeader) - 2) sw = File.AppendText(Path) sw.WriteLine(StrHeader) CnnUser.Close() sw.Flush() sw.Close() Catch ex As Exception MessageBox.Show(ex.Message, "TempID", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try Return Path End Function Now when i am running the programm i am getting this error.I tried hard but not able to locate what could be the problem the error is:- System.Runtime.InteropServices.COMException --Horizontal and vertical pitch must be greater than or equal to the label width and height, respectively. Even though i tried to set the Horizontal and vertical pitch programatically but it gives same err. Plz if any one can help

    Read the article

1