Daily Archives

Articles indexed Tuesday April 20 2010

Page 18/121 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • ListBox Items Not Visible after DataBinding

    - by SidC
    Good Evening All, I am writing a page that allows users to search a parts table, select quantities and a listbox is to be populated with gridview values. Here's a snippet of my aspx page: <asp:ListBox runat="server" ID="lbItems" Width="155px"> <asp:ListItem></asp:ListItem> <asp:ListItem></asp:ListItem> <asp:ListItem></asp:ListItem> <asp:ListItem></asp:ListItem> <asp:ListItem></asp:ListItem> </asp:ListBox> Here's the relevant contents of codebehind: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Define DataTable Columns as incoming gridview fields Dim dtSelParts As DataTable = New DataTable Dim dr As DataRow = dtSelParts.NewRow() dtSelParts.Columns.Add("PartNumber") dtSelParts.Columns.Add("NSN") dtSelParts.Columns.Add("PartName") dtSelParts.Columns.Add("Qty") 'Select those gridview rows that have txtQty <> 0 For Each row As GridViewRow In MySearch.Rows Dim textboxText As String = _ CType(row.FindControl("txtQty"), TextBox).Text If textboxText <> "0" Then 'Create the row dr = dtSelParts.NewRow() 'Fill the row with data dr("PartNumber") = MySearch.DataKeys(row.RowIndex)("PartNumber") dr("NSN") = MySearch.DataKeys(row.RowIndex)("NSN") dr("PartName") = MySearch.DataKeys(row.RowIndex)("PartName") 'Add the row to the table dtSelParts.Rows.Add(dr) End If Next 'Need to send items to Listbox control lbItems lbItems.DataSource = New DataView(dtSelParts) lbItems.DataValueField = "PartNumber" lbItems.DataValueField = "NSN" lbItems.DataValueField = "PartName" lbItems.DataBind() End Sub The page runs fine in that my search functiobnality is intact, and I can input quantity values into my gridview's textbox. When I click Add to Quote the Listbox receives focus, but no list items are visible. I've created several list items in the aspx page, however I don't know how to populate the contents of my datatable in the listbox. Can someone help a newbie with this, seemingly, easy issue? Thanks, Sid

    Read the article

  • function concept

    - by anurag18294
    void execute(int &x,int y=100) { x=x+y; cout< will the following program work in spite of not assigning a default value to the x(formal parameters in the fuction prototype).

    Read the article

  • PHP Warning when using include_once()

    - by Ajith
    When i try to include a file using include_once in php which shows warning like Warning: include_once(1) [function.include-once]: failed to open stream: No such file or directory in /var/www/test/content_box.php on line 2.Actually file is there in my directory.I am using ubuntu (OS) How can we prevent this warning.If anybody know please help me

    Read the article

  • How might one develop a program like FRAPS?

    - by blood
    I would like to make a program to capture video. What is the best way to capture video? I know C++ and I'm learning assembly. I found in my assembly book that I can get data from the video card. Would that be the best way? I know FRAPS hooks into programs, but I would like my program to take video of the entire screen. I would like something something fast, with low memory usage if possible. A requirement is that the program must be usable on other computers, despite dissimilar hardware.

    Read the article

  • string replace in file using C

    - by Hristo
    I haven't yet implemented this, I'm still in the thinking stage, but I have to go through a file and replace a certain string with another string. For example, <img src="/images/logo.gif" ... should become <img src="/proxy/www.example.com/images/logo.gif" ... Any advice on how I can approach this? Perhaps there exist some "string replace" C functions that would do this for me that I don't know about...? Right now, if I had to write this function myself, I would give it as parameters the file, string to replace, replacement string. Then I would manually go through the file and look for an occurrence of the string and recreate it. This, however, seems very inefficient. Are there better ways to do this? Thanks, Hristo

    Read the article

  • Grails Duplicate Exception handling

    - by Srinath
    Hi, How to catch duplicate key exceptions in Grails . when trying to save existing integer for a unique column constraint, the error is generating while saving/updating a record . Also used try{ object.save(flush:true) }catch(org.springframework. dao.DataIntegrityViolationException e){ println e.message }catch(org.hibernate.exception.ConstraintViolationException ex){ println e.message }catch(Exception e){ println e.message } But unable to catch this issue . 23:41:13,265 ERROR [JDBCExceptionReporter:101] Duplicate entry '1' for key 2 23:41:13,281 ERROR [AbstractFlushingEventListener:324] Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) Could you please share the solution to solve this .

    Read the article

  • How to compile ocaml to native code

    - by Indra Ginanjar
    i'm really interested learning ocaml, it fast (they said it could be compiled to native code) and it's functional. So i tried to code something easy like enabling mysql event scheduler. #load "unix.cma";; #directory "+mysql";; #load "mysql.cma";; let db = Mysql.quick_connect ~user:"username" ~password:"userpassword" ~database:"databasename"();; let sql = Printf.sprintf "SET GLOBAL EVENT_SCHEDULER=1;" in (Mysql.exec db sql);; It work fine on ocaml interpreter, but when i was trying to compile it to native (i'm using ubuntu karmic), neither of these command worked ocamlopt -o mysqleventon mysqleventon.ml unix.cmxa mysql.cmxa ocamlopt -o mysqleventon mysqleventon.ml unix.cma mysql.cma i also tried ocamlc -c mysqleventon.ml unix.cma mysql.cma all of them resulting same message File "mysqleventon.ml", line 1, characters 0-1: Error: Syntax error Then i tried to remove the "# load", so the code goes like this let db = Mysql.quick_connect ~user:"username" ~password:"userpassword" ~database:"databasename"();; let sql = Printf.sprintf "SET GLOBAL EVENT_SCHEDULER=1;" in (Mysql.exec db sql);; The ocamlopt resulting message File "mysqleventon.ml", line 1, characters 9-28: Error: Unbound value Mysql.quick_connect I hope someone could tell me, where did i'm doing wrong.

    Read the article

  • Folder browse dialog not showing folders

    - by subash
    I have created an application compiled with .NET 3.5. and used the FolderBrowserDialog object. When a button is pressed i execute this code: FolderBrowserDialog fbd = new FolderBrowserDialog (); fbd.ShowDialog(); A Folder dialog is showed but i can't see any folders. The only thing i see are the buttons OK & Cancel (and create new folder button when the ShowNewFolderButton properyty is set to true). When i try the exact same code on a different form everything is working fine. Any ideas??

    Read the article

  • Why is Magento so slow?

    - by mr-euro
    Is Magento usually so terrible slow? This is my first experience with it and the admin panel simply takes ages to load and save changes. It is a default installation with the test data. The server it is hosted on serves other non-Magento sites super fast. What is it about the PHP code that Magento uses that makes it so slow, and what can be done to fix it?

    Read the article

  • Conditionally set a column to its default value in Postgres

    - by Evgeny
    I've got a PostgreSQL 8.4 table with an auto-incrementing, but nullable, integer column. I want to update some column values and, if this column is NULL then set it to its default value (which would be an integer auto-generated from a sequence), but I want to return its value in either case. So I want something like this: UPDATE mytable SET incident_id = COALESCE(incident_id, DEFAULT), other = 'somethingelse' WHERE ... RETURNING incident_id Unfortunately, this doesn't work - it seems that DEFAULT is special and cannot be part of an expression. What's the best way to do this?

    Read the article

  • How do i know what unixtime a php session will expire?

    - by Steve
    Hi How do I know how many seconds it will be until a php session expires? I'm building a web application where users might spend a lot of time typing into big text fields, but for security reasons I still want sessions to time out after a reasonably short period. I want to warn them if their session is about to expire so they can save or take some other action to keep it alive. Any tips? thanks!

    Read the article

  • How to automate photoshop from the command line.

    - by Raymond
    I have a tool which writes some tags to a photo. On some photos it fails, and for those I want to open them in photoshop, and resave it with maximum quality (jpeg). Ideally I would like to do that from the command line as then I can just do: for %a in (*.jpg) do mytool.exe "%a" || [AUTOMATED PROCESS HERE] I tried first just doing photoshop.exe "%a" but it seems photoshop doesn't even accept a command line argument for what photo to open.

    Read the article

  • How to boot linux direct to application on console with no login

    - by amanda
    I have a need to start an application on bootup on the linux console and I do not have a need for any type of login or security. I do not need any ALT-F1,F2,etc virtual consoles but I would like to allow SSH access via the network port for debugging, loading, etc. The application is a SDL graphics program running with fbcon as the SDL_VIDEODRIVER if that matters. I'm currently using Fedora 10 and 12 but any distro that supports SDL using the fbcon framebuffer would be acceptable.

    Read the article

  • replace a text string

    - by shantanuo
    I want to replace the date found at the end of the "datadir" line with the current date. For e.g. my my.cnf file looks like this... # head /etc/my.cnf [mysqld] #mount -t tmpfs -o size=102m tmpfs /mnt #datadir=/mnt read-only datadir=/mysqlApr5 #datadir=/mysqlApr2 #datadir=/mysqlMar16 #datadir=/mysqlFeb25a Most of the lines are commented. I need to find the datadir line that is not commented and then replace the /mysqlApr4 with /mysqlApr20 datadir=/mysqlApr20 If it is possible I will like to comment the older datadir path. #datadir=/mysqlApr5 I can output the current date as: date '+%b%d' But I want to concat it with the word "/mysql" and replace or comment the current datadir line.

    Read the article

  • Datable.Select sort expression

    - by xyz
    Hi, I have datatable with column name tag and 100 rows of data.I need to filter this table with tag starting with "UNKNOWN". What should my sortexpression for datatable.select be ? I'm trying the following. Datarow[] abc = null; abc = dtTagList.Select(string.format("tag='{0}'","UNKNOWN")) How can I achieve tag startswith 'UNKNOWN' in the above code ?

    Read the article

  • How to troubleshoot deallocation of object in uitableview?

    - by 4thSpace
    I have a table view with tall cells. About 300 in height. The cells are custom and have an associated nib. In cellForRowAtIndexPath, I access an object in an array using indexPath.row. The object has properties, which I assign to labels on the custom cell. This works fine for the first two cells. Once I scroll enough for the third cell to get created, the app crashes. I have NSZombieEnabled set and here is the output: 2010-04-19 21:48:13.360 MyApp[54463:207] *** -[CALayer release]: message sent to deallocated instance 0xfc4e50 (gdb) continue 2010-04-19 21:48:18.382 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement methodSignatureForSelector: -- trouble ahead 2010-04-19 21:48:18.383 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement doesNotRecognizeSelector: -- abort (gdb) continue Program received signal: “EXC_BAD_ACCESS”. (gdb) I'm not sure what is deallocated. How can I trace this to the source?

    Read the article

  • CheckBox and the ContextMenu

    - by anselmophil
    Hi guys! I have in a ListView with a ContextMenu, it has one CheckBox (the CheckBox has android:focusable="false") and one TextView per row, but you can hide the TextView in the preferences menu. After doing that, the CheckBox wasnt registering the ContextMenu, so of course, why not registerForContextMenu(cb) and unregisterForContextMenu(getListView())? Yes, i did that, but then, when when i call the delete command of onContextItemSelected, the app crashs. AdapterContextMenuInfo info=(AdapterContextMenuInfo)item.getMenuInfo(); db.deletarTarefa(info.id); So here i am, accepting ideias and help! :) Thanks

    Read the article

  • Problem with moving a winform using C#

    - by karthik
    My form doesn't have a title bar, so I am implementing the code to drag the entire form around the screen. I am using the below code to do it, which works fine. I have two panels in my form, PanelA and PanelB. During the startup I show PanelA where the dragging works perfectly. Later when the user clicks the button in PanelA, I need to make PanelA invisible and show PanelB However, the dragging does not work when PanelB is shown. What's the problem here? private void SerialPortScanner_MouseUp(object sender, MouseEventArgs e) { this.drag = false; } private void SerialPortScanner_MouseDown(object sender, MouseEventArgs e) { this.drag = true; this.start_point = new Point(e.X, e.Y); } private void SerialPortScanner_MouseMove(object sender, MouseEventArgs e) { if (this.drag) { Point p1 = new Point(e.X, e.Y); Point p2 = this.PointToScreen(p1); Point p3 = new Point(p2.X - this.start_point.X, p2.Y - this.start_point.Y); this.Location = p3; } }

    Read the article

  • Apples new section 3.3.1

    - by ML
    With Apple making changes to section 3.3.1 on the iPhone dev agreement can one stillness libraries like boost in their apps? I want to use Boost in my iPad app...

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >