Search Results

Search found 687 results on 28 pages for 'rs'.

Page 10/28 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • populate jsp drop down with database info

    - by Cano63
    Hello, people, i,m looking for the way to populate a jsp dropdown. I want that when the jsp load it fill the dropdown with the info that i have in a database table. Down I,m icluding the code of my class that will create the array and fill it with the database info. Whant i don,t know is how to call that class from my jsp and fill the dropdown. '// this will create my array public static ArrayList getBrandsMakes() { ArrayList arrayBrandsMake = new ArrayList(); while(rs.next()) { arrayBrandsMake.add(loadOB(rs)); // CARGO MI ARREGLO CON UN OBJETO } return arrayBrandsMake; } } //this will load my array object private static DropDownBrands loadOB(ResultSet rs)throws SQLException { DropDownBrands OB = new DropDownBrands (); OB.setBrands("BRAN"); return OB; } '

    Read the article

  • Sliding in Winforms form

    - by rs
    Hi, I'm making a form at the bottom of the screen and I want it to slide upwards so I wrote the following code: int destinationX = (Screen.PrimaryScreen.WorkingArea.Width / 2) - (this.Width / 2); int destinationY = Screen.PrimaryScreen.WorkingArea.Height - this.Height; this.Location = new Point(destinationX, destinationY + this.Height); while (this.Location != new Point(destinationX, destinationY)) { this.Location = new Point(destinationX, this.Location.Y - 1); System.Threading.Thread.Sleep(100); } but the code just runs through and shows the end position without showing the form sliding in which is what I want. I've tried Refresh, DoEvents - any thoughts?

    Read the article

  • Gridview and Modal popup not updating

    - by rs
    I have page with following controls <asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <uc2:CountryControl ID="Country1" runat="server" /> <br class = "br_e" /> <br class = "br_e" /> <asp:UpdatePanel ID="upCountry2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Panel runat="server" ID="pnCountry" Width="400px" Visible="false"> <asp:GridView ID="gvCountry" runat="server" AllowSorting="true" DataKeyNames="countryid" DataSourceID="data_country1" AutoGenerateColumns="false"> <Columns> <asp:CommandField ButtonType="Link" ShowDeleteButton="true" /> <asp:BoundField HeaderText="Country" DataField="CountryName" SortExpression="CountryName" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="data_country1" runat="server" ConnectionString="<%$ zyx %>" SelectCommand="xyz" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:SessionParameter Name="country" DefaultValue="" ConvertEmptyStringToNull="true" SessionField="CountryID" Type="String" /> </SelectParameters> </asp:SqlDataSource> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> </ContentTemplate> </asp:UpdatePanel> My user control is a modal popup to select country and add selected ids to a session variable. And in main page bind data using ids in session variable.Gridview - on deleting event i'm deleting that id from session and on deleted event updating both user control using a refresh method (Country1.Refresh()) and gridview panel. But updatepanel is not getting updated and even modalpopup is also not getting refreshed. What could be wrong here? Even though update and refresh events are fired and executed, why is page not getting updated?

    Read the article

  • JDBC resultset close

    - by KM
    I am doing profiling of my Java application and found some interesting statistics for a jdbc PreparedStatement call: Given below is the environment details: Database: Sybase SQL Anywhere 10.0.1 Driver: com.sybase.jdbc3.jdbc.SybDriver connection pool: c3p0 JRE: 1.6.0_05 The code in question is given below: try { ps = conn.prepareStatement(sql); ps.setDouble(...); rs = ps.executeQuery(); ...... return xyz; } finally { try { if (rs != null) rs.close(); if (ps != null) ps.close(); } catch (SQLException sqlEx) { } } From JProfiler stats, I find that this particular resultspace.close() statement alone takes a large amount of time. It varies from 25 ms to 320s while for other code blocks which are of identical in nature, i find that this takes close to 20 microseconds. Just to be sure, I ran this performance test multiple times and confirmed this data. I am puzzled by this behaviour - Thoughts?

    Read the article

  • updateBinaryStream on ResultSet with FileStream

    - by Lieven Cardoen
    If I try to update a FileStream column I get following error: com.microsoft.sqlserver.jdbc.SQLServerException: The result set is not updatable. Code: System.out.print("Now, let's update the filestream data."); FileInputStream iStream = new FileInputStream("c:\\testFile.mp3"); rs.updateBinaryStream(2, iStream, -1); rs.updateRow(); iStream.close(); Why is this? Table in Sql Server 2008: CREATE TABLE [BinaryAssets].[BinaryAssetFiles]( [BinaryAssetFileId] [int] IDENTITY(1,1) NOT NULL, [FileStreamId] [uniqueidentifier] ROWGUIDCOL NOT NULL, [Blob] [varbinary](max) FILESTREAM NULL, [HashCode] [nvarchar](100) NOT NULL, [Size] [int] NOT NULL, [BinaryAssetExtensionId] [int] NOT NULL, Query used in Java: String strCmd = "select BinaryAssetFileId, Blob from BinaryAssets.BinaryAssetFiles where BinaryAssetFileId = 1"; stmt = con.createStatement(); rs = stmt.executeQuery(strCmd);

    Read the article

  • Populate JSP dropdown with database info

    - by Cano63
    I'm looking for the way to populate a JSP dropdown. I want that when the JSP loads it fills the dropdown with the info that I have in a database table. I'm including the code of my class that will create the array and fill it with the database info. What I don't know is how to call that class from my JSP and fill the dropdown. // this will create my array public static ArrayList<DropDownBrands> getBrandsMakes() { ArrayList<DropDownBrands> arrayBrandsMake = new ArrayList<DropDownBrands>(); while (rs.next()) { arrayBrandsMake.add(loadOB(rs)); // CARGO MI ARREGLO CON UN OBJETO } return arrayBrandsMake; } // this will load my array object private static DropDownBrands loadOB(ResultSet rs) throws SQLException { DropDownBrands OB = new DropDownBrands(); OB.setBrands("BRAN"); return OB; }

    Read the article

  • UpdatePanel and ModalPopup Extender

    - by rs
    I have my form designed as <asp:Panel runat="server" Id="xyz"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> 'Gridview with edit/delete - opens detailsview(edit template) with data for editing </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> 'Hyperlink to open detailsview(insert template) for inserting records </ContentTemplate> </asp:UpdatePanel> </asp:Panel> <asp:Panel runat="server" Id="xyz1"> 'Ajax modal popup extender control </asp:Panel> It works perfectly when i click update, insert alternately, but when i click insert hyperlink (which is outside gridview) and close/cancel popup without any insert and then again click insert it doesn't call insert_onclick event. It works if i click some other button and click this button. What could be causing this issue and how can i solve it?

    Read the article

  • Strange Exception on getGeneratedKeys() with JDBC for MySQL 5.1

    - by sweeney
    Hello, I'm using JDBC to insert a row into a MYSQL database. I build a parameterized command, execute it and attempt to retrieve the auto generated keys as follows: String sql = "INSERT IGNORE INTO `users` (`email`, `pass-hash`) VALUES (?, ?)"; Connection conn = SQLAccess.getConnection(); PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1, login); ps.setString(2, passHash); int count = ps.executeUpdate(); if (count == 1) { ResultSet rs = ps.getGeneratedKeys(); rs.next(); //some more stuff... } For some reason, I get the following SQLException on the line containing ResultSet rs = ps.getGeneratedKeys();: !Statement.Generated Keys Not Requested! Any thoughts? When I run the same query, as generated by running the app through the debugger, in a MySQL browser it executes without incident. Thanks, brian

    Read the article

  • Advice about insert into SQLCE

    - by Alexander
    i am inserting about 1943 records by these function into SQLCE.This is my insert function.Parameters come from StringReader(string comes from webservice).This function executes 1943 times and takes about 20 seconds.I dropped table's indexes,what can i do to improve it?I create just 1 time mycomm and sqlceresultset. Public Function Insert_Function(ByVal f_Line() As String, ByRef myComm As SqlCeCommand, ByRef rs As SqlCeResultSet) As String Try Dim rec As SqlCeUpdatableRecord = rs.CreateRecord() rec.SetInt32(0, IIf(f_Line(1) = "", DBNull.Value, f_Line(1))) rec.SetInt32(1, IIf(f_Line(2) = "", DBNull.Value, f_Line(2))) rec.SetInt32(2, IIf(f_Line(3) = "", DBNull.Value, f_Line(3))) rec.SetInt32(3, IIf(f_Line(4) = "", DBNull.Value, f_Line(4))) rec.SetValue(4, IIf(f_Line5(5) = "", DBNull.Value, f_Line(5))) rs.Insert(rec) rec = Nothing Catch ex As Exception strerr_col = ex.Message End Try Return strerr_col End Function

    Read the article

  • What are the names of network interfaces on the Motorola CLIQ?

    - by RS
    The network interfaces on Android interfaces are listed as directories in the file system in /sys/class/net/. For most Android devices the network interface for gprs traffic is called rmnet0 and for Wi-Fi it's usually eth0 or tiwlan0. I suspect that the cell interface for the Motorola CLIQ is rmnet0, but I would like to have this confirmed + know the name of the Wi-Fi interface. Also it would be good to know the device id for this model. This is the value available as android.os.Build.DEVICE in the Java SDK. (E.g. T-Mobile G1 uses dream, Samsung Galaxy uses GT-I7500, and Motorolda Droid uses sholes.)

    Read the article

  • How do I change Windows Service environment path

    - by rs
    I need to change thw environment variable Environment.GetEnvironmentVariable("TMP") for a Windows service in .NET 2.0 that is running with its own user account. The server is a Windows Server 2003, SP2. Can anybody tell me how to change the Windows environment variable for that user?

    Read the article

  • SQL Server - CAST AND DIVIDE

    - by rs
    DECLARE @table table(XYZ VARCHAR(8) , id int) INSERT INTO @table SELECT '4000', 1 UNION ALL SELECT '3.123', 2 UNION ALL SELECT '7.0', 3 UNION ALL SELECT '80000', 4 UNION ALL SELECT NULL, 5 SELECT CASE WHEN PATINDEX('^[0-9]{1,5}[\.][0-9]{1,3}$', XYZ) = 0 THEN XYZ WHEN PATINDEX('^[0-9]{1,8}$',XYZ) = 0 THEN CAST(XYZ AS decimal(18,3))/1000 ELSE NULL END FROM @table This part - CAST(XYZ AS decimal(18,3))/1000 doesn't divide value it gives me more number of zeros after decimal instead of dividing it. (I even enclosed that in brackets and tried but same result) Am i doing something wrong here?

    Read the article

  • Design SQL Query for following case

    - by rs
    Consider tables Table1 id, name 1 xyz 2 abc 3 pqr Table2 id title 1 Mg1 2 Mg2 3 SG1 Table3 Tb1_id tb2_id count 1 1 3 1 2 3 1 3 4 2 2 1 3 2 2 3 3 2 I want to do query to give result like id title 1 MG1 2 MG2 3 Two or More Title MG1 has higher preference if MG1 and count = 1 then it is given as MG1 title , for others corresponding title is used and for count 1 as two or more

    Read the article

  • Upgrading to ASP.NET 3.5

    - by rs
    I have a server with some asp, asp.net 1.0 and 2.0 running on them. Now I'm planning to host 3.5 apps on them. Do i have to make any changes to server other than installing framework to make it handle all my previous version apps? Do i have to install new IIS or i can use same iis for 3.5? Do i have to install ajax newer version to suport ajax 3.5?

    Read the article

  • Passing delimited string to stored procedure to search database

    - by rs
    How can i pass a string delimited by space or comma to stored procedure and filter result? I'm trying to do something like - Parameter Value -------------------------- @keywords key1 key2 key3 Then is stored procedure i want to first find all records with first or last name like key1 filter step 1 with first or last name like key2 filter step 2 with first or last name like key 3

    Read the article

  • How to make <option selected="selected"> set by MySql and PHP?

    - by Binyamin
    How to make <option selected="selected"> set by MySql and PHP? My code: echo '<select>'; $tempholder = array(); $rs = mysql_query("SELECT * FROM id ORDER BY year"); $nr = mysql_num_rows($rs); for ($i=0; $i<$nr; $i++){ //if($year=$r["year"]){ $selected=' selected="selected"'; }//doesn't work so $r = mysql_fetch_array($rs); if (!in_array($r['year'], $tempholder)){ $tempholder[$i] = $r['year']; echo "<option>".$r["year"]."</option>";//<option$selected>... } } unset($tempholder); echo '</select>';

    Read the article

  • Javascript not registering/executing after button click

    - by rs
    I have a textbox which i convert to tinymce textbox using tinymce.js file. I'm trying to add a new script with database fields substituted based on selection made from dropdownlist to page using registerstartupscript. In page load protected sub page_load(byVal sender as object, byval e as EventArgs) handles me.load AddScriptToPage() if not page.ispostback() then session("fname") = nothing end if end sub Script Method Sub AddScriptToPage() dim _script = " c.onRenderMenu.add(function(c, m) { " & _ add_columns() & _ "}); " ClientScript.RegisterStartupScript(Me.GetType(), keyword,_script) End Sub function add_columns() as string dim ret_string = String.empty select case ddlList.selectedvalue case 1 sqlcommand = "xyz" case 2 sqlcommand = "xyz" case 3 //Load from excel sqlcommand = nothing end select if sqlcommand isnot nothing then executereader() while reader.read() ret_string = ret_string & reader("column") end while elseif session("fname") isnot nothing dt = getdatatable(session("fname").tostring()) //method that opens oledb connection and returns columns for each dr in dt.rows ret_string = ret_string & dr("column") next end if add_columns = ret_string end function When excel file is uploaded to server this event is called protected sub btnclick(byVal sender as object, byval e as EventArgs) if hasfile then 'i have custom properties set after control validation 'Upload file 'set session value with filepath session("fname") = filepath 'call js register event AddScriptToPage() end if end sub When i click upload button i'm calling AddScriptToPage, and debug it it hits AddScripttoPage event and executes it but it doesn't showup on page. It should show column names in tinymce editor but it doesn't. But when i click another button on the same page it shows (becos session has the filename). On Upload button click page flow: Page load - AddScriptToPage is executed (registers scripts with no columns) Then AddScriptToPage in btnclick event is executed (registers scripts with columns) Why is this script not getting registered even though it is executed on vb code on uploadclick event? And why does it show up after another button click and not original button click that calls this event?

    Read the article

  • Linq query joining with a subquery

    - by Alan Fisher
    I am trying to reproduce a SQL query using a LINQ to Entities query. The following SQL works fine, I just don't see how to do it in LINQ. I have tried for a few hours today but I'm just missing something. SELECT h.ReqID, rs.RoutingSection FROM ReqHeader h JOIN ReqRoutings rr ON rr.ReqRoutingID = (SELECT TOP 1 r1.ReqRoutingID FROM ReqRoutings r1 WHERE r1.ReqID = h.ReqID ORDER BY r1.ReqRoutingID desc) JOIN ReqRoutingSections rs ON rs.RoutingSectionID = rr.RoutingSectionID Edit*** Here is my table scema- Requisitions: ReqID PK string ReqDate datetime etc... ReqRoutings: ID PK int ReqID FK RoutingSection FK int RoutingDate ReqRoutingSections: Id PK int RoutingSection string The idea is that each Requisition can be routed many times, for my query I need the last RoutingSection to be returned along with the Requisition info. Sample data: Requisitions: - 1 record ReqID 123456 ReqDate '12/1/2012' ReqRoutings: -- 3 records id 1 ReqID 123456 RoutingSection 3 RoutingDate '12/2/2012' id 2 ReqID 123456 RoutingSection 2 RoutingDate '12/3/2012' id 3 ReqID 123456 RoutingSection 4 RoutingDate '12/4/2012' ReqRoutingSections: -- 3 records id 2 Supervision id 3 Safety id 4 Qaulity Control The results of the query would be ReqID = '123456' RoutingSection = 'QualityControl' -- Last RoutingSection requisition was routed to

    Read the article

  • how to show image from ms access to jpanel in java netbeans

    - by Shiv
    I have used this code : private void okActionPerformed(java.awt.event.ActionEvent evt) { try { String Update = name.getText(); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection connection = DriverManager.getConnection("jdbc:odbc:NewPData"); PreparedStatement psmnt = connection.prepareStatement("SELECT Image FROM Table1 where Name='" + Update + "'"); ResultSet rs = psmnt.executeQuery(); Blob blob = rs.getBlob("Image"); int b; InputStream bis = rs.getBinaryStream("Image"); FileOutputStream f = new FileOutputStream("Image.jpg"); while ((b = bis.read()) >= 0) { f.write(b); } f.close(); bis.close(); icon = new ImageIcon(blob.getBytes(1L, (int) blob.length())); lblImage.setIcon(icon); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } Exception it show is java.lang.UnsupportedOperationException i have stored image first in ms access and now i want to show it on a label plz help

    Read the article

  • C# How to download files from FTP Server

    - by user3696888
    I'm trying to download a file (all kinds of files, exe dll txt etc.). And when I try to run it an error comes up on: using (FileStream ws = new FileStream(destination, FileMode.Create)) This is the error message: Access to the path 'C:\Riot Games\League of Legends\RADS\solutions \lol_game_client_sln\releases\0.0.1.41\deploy'(which is my destination, where I want to save it) is denied. Here is my code void download(string url, string destination) { FtpWebRequest request = (FtpWebRequest)WebRequest.Create(url); request.Method = WebRequestMethods.Ftp.DownloadFile; request.Credentials = new NetworkCredential("user", "password"); request.UseBinary = true; using (FtpWebResponse response = (FtpWebResponse)request.GetResponse()) { using (Stream rs = response.GetResponseStream()) { using (FileStream ws = new FileStream(destination, FileMode.Create)) { byte[] buffer = new byte[2048]; int bytesRead = rs.Read(buffer, 0, buffer.Length); while (bytesRead > 0) { ws.Write(buffer, 0, bytesRead); bytesRead = rs.Read(buffer, 0, buffer.Length); } } } }

    Read the article

  • What are the names of network interfaces on the Motorola CLIQ XT?

    - by RS
    The network interfaces on Android interfaces are listed as directories in the file system in /sys/class/net/. For most Android devices the network interface for gprs traffic is called rmnet0 and for Wi-Fi it's usually eth0 or tiwlan0. I suspect that the cell interface for the Motorola CLIQ XT is rmnet0, but I would like to have this confirmed + know the name of the Wi-Fi interface. Also it would be good to know the device id for this model. This is the value available as android.os.Build.DEVICE in the Java SDK. (E.g. T-Mobile G1 uses dream, Samsung Galaxy uses GT-I7500, and Motorolda Droid uses sholes.)

    Read the article

  • Visual Source Safe New files check in

    - by rs
    I have asp files on server and i created a working folder and checked out code. I then created new files in working folder and did checkin but they new files are not copied. Does VSS do not copy new files or is there a way i can check in those files to VSS database.

    Read the article

  • Returning more than 1000 rows in classic asp adodb.recordset

    - by peg_leg
    My code in asp classic, doing a mssql database query: rs.pagesize = 1000 ' this should enable paging rs.maxrecords = 0 ' 0 = unlimited maxrecords response.write "hello world 1<br>" rs.open strSql, conn response.write "hello world 2<br>" My output when there are fewer than 1000 rows returned is good. More than 1000 rows and I don't get the "hello world 2". I thought that setting pagesize sets up paging and thus allows all rows to be returned regardless of how many rows there are. Without setting pagesize, paging is not enable and the limit is 1000 rows. However my page is acting as if pagesize is not working at all. Please advise.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >