Search Results

Search found 1402 results on 57 pages for 'dataset'.

Page 41/57 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Entity Framework associations killing performance

    - by Chris
    Here is the performance test i am looking at. I have 8 different entities that are table per type. Some of the entities contain over 100 thousand rows. This particular application does several recursive calculations on the client so I think it may be best to preload the data instead of lazy loading. If there are no associations I can load the entire database in about 3 seconds. As I add associations in any way the performance starts to drastically decline. I am loading all the data the same way (just calling toList() on the entity attached to the context). I ran the test with edmx generated classes and self tracking entities and had similar results. I am sure if I were to try and deal with the associations myself, similar to how I would in a dataset, the performance problem would go away. On the other hand I am pretty sure this is not how the entity framework was intended to being used. Any thoughts or ideas?

    Read the article

  • Windows Azure Table Storage LINQ Operators

    - by Ryan Elkins
    Currently Table Storage supports From, Where, Take, and First. Are there plans to support any of the other 29 operators? If we have to code for these ourselves, how much of a performance difference are we looking at to something similar via SQL and SQL Server? Do you see it being somewhat comparable or will it be far far slower if I need to do a Count or Sum or Group By over a gigantic dataset? I like the Azure platform and the idea of cloud based storage. I like Windows Azure for the amount of data it can store and the schema-less nature of table storage. SQL Azure just won't work due to the high cost to storage space.

    Read the article

  • asp.net datasource problem

    - by harold-sota
    I'm insert a dropdwon list in datagrid on row editing. wen i run the project the datasource is not rekognized <asp:TemplateField HeaderText="Lookup 1"> <EditItemTemplate> <asp:DropDownList ID="Loocup1DropDownList" Width="100%" runat="server" DataSource ="<%GetValueForDropDownCombinationContent()%>" DataValueField="LOOKUP_ID" DataTextField="lookup_name" > </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label ID="LOOKUP1_NAME" runat="server" Text='<%# Bind("LOOKUP1_NAME") %>'></asp:Label> </ItemTemplate> This is the vb.net function Protected Function GetValueForDropDownCombinationContent() As IDataSource Dim dsProductLookups As New DataSet dsProductLookups = DocumentManager.Data.DataRepository.Provider.ExecuteDataSet("sp_GetCombinationsLookups", productCombo.SelectedValue) Return dsProductLookups End Function any ideas???

    Read the article

  • .net Studio Local Database

    - by testerwpf
    Hello everyone, i am designing a local database in .net with wpf as gui. I have added a new database, and added a new table. Through the TableAdapter i generated 2 statements ( 1 statement is a select stmt and 1 is a insert) , i insert name and firstname (id is auto generated). It works fine, i can display the table in a datagrid (wpf toolkit) and also add new items (name,firstname), when i close and start the application everything is fine (data in table is stored) BUT when i try to preview data in my database dataset (where my Adapters exist) , no data is displayed and then the table gets deleted.. why? public partial class MainWindow : Window { public MainWindow() { this.InitializeComponent(); PlayerTableAdapter objPlayerTableAdapter = new PlayerTableAdapter(); objDataGridResults.ItemsSource = objPlayerTableAdapter.GetDataAllPlayer(); } //Button Event onClick private void m_voidAddPlayer(object sender, System.Windows.RoutedEventArgs e) { PlayerTableAdapter objPlayerTableAdapter = new PlayerTableAdapter(); objPlayerTableAdapter.InsertQueryPlayer(objTextBoxPlayerName.Text.ToString(), objTextBoxPlayerFirstName.Text.ToString()); objDataGridResults.ItemsSource = objPlayerTableAdapter.GetDataAllPlayer(); } }

    Read the article

  • free public databases with non-trivial table structures?

    - by Caffeine Coma
    I'm looking for some sample database data that I can use for testing and demonstrating a DB tool I am working on. I need a DB that has (preferably) many tables, and many foreign key relationships between the tables. Ideally the data would be in SQL dump format, or at least in something that maintains the foreign key references, and could be easily import into an RDBMS (MySQL or H2). The dataset itself doesn't have to be huge (in fact, best if it's not). I thought about using the Stackoverflow Data Dump, but it's only about 5 tables.

    Read the article

  • Hierarchical Data in MySQL is fast to retrieve?

    - by ajsie
    i've got a list of all countries - states - cities (- subcities/villages etc) in a XML file and to retrieve for example a state's all cities it's really quick with XML (using xml parser). i wonder, if i put all this information in mysql, is retrieving a state's all cities as fast as with XML? cause XML is designed to store hierarchical data while relational databases like mysql are not. the list contains like 500 000 entities. so i wonder if its as fast as XML using either of: Adjacency list model Nested Set model And which one should i use? Cause (theoretically) there could be unlimited levels under a state. And which is fastest for this huge dataset? Thanks!

    Read the article

  • How do I create queries to SQL Server tables via Visual Studio when no knowledge about SQL nor Linq?

    - by Kent S. Clarkson
    Let´s be frank, my knowledge regarding SQL language is very low. Nevertheless, my boss gave me the task to build a database application using the following tools: SQL Server and Visual Studio 2008; C#. I use the VS DataSet as a local mirror of the SQL Server. And let´s be frank again, my understanding of the VS Query builder is also very small, I´m finding it quite confusing, actually. So no help to find from Query builder. And my knowledge of Linq is even lower... Perhaps I should mention that the deadline for the project is "aggressively" set, so I have no chance to learn enough about these things during the project. And I´m a bit stupid too, which is no help when it comes to challenges like this (on other occations it might be quite useful though) With these permissions, what should I do (except for killing myself or retire) to be able to query my tables in a sufficient way?

    Read the article

  • Hierarchical Data in MySQL is as fast as XML to retrieve?

    - by ajsie
    i've got a list of all countries - states - cities (- subcities/villages etc) in a XML file and to retrieve for example a state's all cities it's really quick with XML (using xml parser). i wonder, if i put all this information in mysql, is retrieving a state's all cities as fast as with XML? cause XML is designed to store hierarchical data while relational databases like mysql are not. the list contains like 500 000 entities. so i wonder if its as fast as XML using either of: Adjacency list model Nested Set model And which one should i use? Cause (theoretically) there could be unlimited levels under a state (i heard that adjacency isn't good for unlimited child-levels). And which is fastest for this huge dataset? Thanks!

    Read the article

  • How to pass parameters to report model in Reporting Services

    - by savras
    I'm developing report in RS that show top N customers based on some criteria. It also allows to select number of customers and period of time. Is it possible to do it by using report model? Thing that it seems to be difficult is how to pass parameters determined by user. Another thing that in my oppinion is very disappointing is that i cannot use SQL query as dataset query, because it uses odd and elaborate XML. Although report model items seem to map its fields to query or table fields. I m concerning using report models because i need to provide uniform data model (the same tables and fields) for more or less different database schemas. It would be very nice if somebody would explain what can be done with report models and what can not.

    Read the article

  • How to create Master/Detail view with two datagrids in ColdFusion

    - by Maklar
    In Coldfusion, I have Master and Detail data that I need to display in two separate cfgrids; like the typical Customers/Orders scenario. My cfgrids are bound to cfc functions which populate the cfgrids. In my current dataset, only one Customer has Orders and when I click on this record in the Master datagrid the Detail datagrid displays the related records. But when I click on a record in the Master datagrid that has no related detail records, the Detail datagrid does not refresh but maintains display of the previous data. Also the search icon within the datagrid's control panel indicates it is searching for values rather than displaying the Refresh icon. Can you please show me how to establish Master and Detail cfgrids where I can see Orders of Customers as I navigate through the Master datagrid? Any and all help will be greatly appreciated! Maklar

    Read the article

  • ASP.Net repeater item.DataItem is null

    - by mattgcon
    Within a webpage, upon loading, I fill a dataset with two table with a relation between those tables and then load the data into a repeater with a nested repeater. This can also occur after the user clicks on a button. The data gets loaded from a SQL database and the repeater datasource is set to the dataset after a postback. However, when ItemDataBound occurs the Item.Dataitem is always null. Why would this occur? below is my HTML repeater code <asp:Repeater ID="rptCustomSpaList" runat="server" onitemdatabound="rptCustomSpaList_ItemDataBound"> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <table> <tr> <td> <asp:Label ID="Label3" runat="server" Text="Spa Series:"></asp:Label> </td> <td> <asp:Label ID="Label4" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SPASERIESVALUE") %>'></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label5" runat="server" Text="Spa Model:"></asp:Label> </td> <td> <asp:Label ID="Label6" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SPAMODELVALUE") %>'></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label9" runat="server" Text="Acrylic Color:"></asp:Label> </td> <td> <asp:Label ID="Label10" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ACRYLICCOLORVALUE") %>'></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label11" runat="server" Text="Cabinet Color:"></asp:Label> </td> <td> <asp:Label ID="Label12" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CABPANCOLORVALUE") %>'></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label17" runat="server" Text="Cabinet Type:"></asp:Label> </td> <td> <asp:Label ID="Label18" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CABINETVALUE") %>'></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label13" runat="server" Text="Cover Color:"></asp:Label> </td> <td> <asp:Label ID="Label14" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "COVERCOLORVALUE") %>'></asp:Label> </td> </tr> </table> <asp:Label ID="Label15" runat="server" Text="Options:"></asp:Label> <asp:Repeater ID="rptCustomSpaItem" runat="server"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "PROPERTY") %>'></asp:Label> </td> <td> <asp:Label ID="Label2" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "VALUE") %>'></asp:Label> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> <table> <tr> <td style="padding-top:15px;padding-bottom:30px;"> <asp:Label ID="Label7" runat="server" Text="Configured Price:"></asp:Label> </td> <td style="padding-top:15px;padding-bottom:30px;"> <asp:Label ID="Label8" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SPAVALUEVALUE") %>'></asp:Label> </td> </tr> </table> <asp:Label ID="Label16" runat="server" Text="------"></asp:Label> </ItemTemplate> <FooterTemplate></FooterTemplate> </asp:Repeater>

    Read the article

  • Optimal Sharing of heavy computation job using Snow and/or multicore

    - by James
    Hi, I have the following problem. First my environment, I have two 24-CPU servers to work with and one big job (resampling a large dataset) to share among them. I've setup multicore and (a socket) Snow cluster on each. As a high-level interface I'm using foreach. What is the optimal sharing of the job? Should I setup a Snow cluster using CPUs from both machines and split the job that way (i.e. use doSNOW for the foreach loop). Or should I use the two servers separately and use multicore on each server (i.e. split the job in two chunks, run them on each server and then stich it back together). Basically what is an easy way to: 1. Keep communication between servers down (since this is probably the slowest bit). 2. Ensure that the random numbers generated in the servers are not highly correlated.

    Read the article

  • Save BLOB to disk as Image C#

    - by TGuimond
    Hello, I am developing a web application that calls web services developed by a third party to send/receive data from a clients database. I am building the application using ASP.NET 3.5 C#. The way that they are providing me images is in BLOB format. I call their method and what I get back is a DataSet with 2 fields "logo_name" and "logo" which is the BLOB field. What I want to do is: Save the image locally on the disk (to minimize calls to their database in the future). I have been playing around with a couple of different ways of doing this but cannot seem to get the image to save correctly. I have been able to create a file in a folder with the correct name but if I try to view the image it does not work. I was hoping someone could give me some sample code to show me how to save a BLOB field to the local disk? Thanks

    Read the article

  • How can I dynamically inject code to event handlers in Delphi?

    - by mjustin
    For debugging / performance tests I would like to dynamically add logging code to all event handlers of components of a given type. For example, for all Dataset components located ona TDatamodule, I would like to add some code for the BeforeOpen and the AfterOpen event to store the start and end time and send a line to a logger with the elapsed time in the AfterOpen event. I would prefer to do this dynamically (no component subclassing), so that I can add this to all existing datamodules and forms with minimal effort only when needed. Iterating all components and filtering by their type is easy, but for the components which already have event handlers assigned, I need a way to store the existing event handlers, and assign a new modified event handler which first does the logging and then will invoke the original code which was already present. Is there a design pattern which can be applied, or even some example code which shows how to implement this in Delphi?

    Read the article

  • R ggplot barplot; Fill based on two separate variables

    - by user1476968
    A picture says more than a thousand words. As you can see, my fill is based on the variable variable. Within each bar there is however multiple data entities (black borders) since the discrete variable complexity make them unique. What I am trying to find is something that makes each section of the bar more distinguishable than the current look. Preferable would be if it was something like shading. Here's an example (not the same dataset, since the original was imported): dat <- read.table(text = "Complexity Method Sens Spec MMC 1 L Alpha 50 20 10 2 M Alpha 40 30 80 3 H Alpha 10 10 5 4 L Beta 70 50 60 5 M Beta 49 10 80 6 H Beta 90 17 48 7 L Gamma 19 5 93 8 M Gamma 18 39 4 9 H Gamma 10 84 74", sep = "", header=T) library(ggplot2) library(reshape) short.m <- melt(dat) ggplot(short.m, aes(x=Method, y= value/100 , fill=variable)) + geom_bar(stat="identity",position="dodge", colour="black") + coord_flip()

    Read the article

  • jQuery-AJAX to rebind dropdown list to results from stored procedure

    - by webworm
    I have a dropdown list of peoples names that is quite long. As many as 2,000 names. I would like to make it easier to find the name the user is interested in by limiting the dropdown list to a subset of names at a time. I have done this by creating a series of 26 links (A, B, C ... Z) that call a method in the code behind that populates the dropdown list with only those names starting with the letter the user clicked. This all works well but I would like to be able to use AJAX to accomplish this update of the dropdown list without a page refresh. I would like to use jQuery for the AJAX functionality rather than ASP.NET AJAX. My problem is I am not sure how to execute the stored procedure and then "rebind" the dropdown list with the new dataset via jQuery AJAX. Any suggestions or resources that might provide and example or walk-through? Thank you.

    Read the article

  • How do I remove the time from printpreview dialog?

    - by Albo Best
    Here is my code: Imports System.Data.OleDb Imports System.Drawing.Printing Namespace Print Public Class Form1 Inherits System.Windows.Forms.Form Dim PrintC As PrinterClass Dim conn As OleDb.OleDbConnection Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\\db1.mdb" Dim sql As String = String.Empty Dim ds As DataSet Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FillDataGrid() '//create printerclass object PrintC = New PrinterClass(PrintDocument1, dataGrid) End Sub Private Sub FillDataGrid() Try Dim dt As New DataTable Dim ds As New DataSet ds.Tables.Add(dt) Dim da As New OleDbDataAdapter con.Open() da = New OleDbDataAdapter("SELECT * from klient ", con) da.Fill(dt) con.Close() dataGrid.DataSource = dt.DefaultView Dim dTable As DataTable For Each dTable In ds.Tables Dim dgStyle As DataGridTableStyle = New DataGridTableStyle dgStyle.MappingName = dTable.TableName dataGrid.TableStyles.Add(dgStyle) Next ' DataGrid settings dataGrid.CaptionText = "TE GJITHE KLIENTET" dataGrid.HeaderFont = New Font("Verdana", 12) dataGrid.TableStyles(0).GridColumnStyles(0).Width = 60 dataGrid.TableStyles(0).GridColumnStyles(1).Width = 140 dataGrid.TableStyles(0).GridColumnStyles(2).Width = 140 dataGrid.TableStyles(0).GridColumnStyles(3).Width = 140 dataGrid.TableStyles(0).GridColumnStyles(4).Width = 140 dataGrid.TableStyles(0).GridColumnStyles(5).HeaderText = "" dataGrid.TableStyles(0).GridColumnStyles(5).Width = -1 Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click 'create printerclass object PrintC = New PrinterClass(PrintDocument1, dataGrid) PrintDocument1.Print() End Sub Private Sub btnPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPreview.Click 'create printerclass object PrintC = New PrinterClass(PrintDocument1, dataGrid) ''preview Dim ps As New PaperSize("A4", 840, 1150) ps.PaperName = PaperKind.A4 PrintDocument1.DefaultPageSettings.PaperSize = ps PrintPreviewDialog1.WindowState = FormWindowState.Normal PrintPreviewDialog1.StartPosition = FormStartPosition.CenterScreen PrintPreviewDialog1.ClientSize = New Size(600, 600) PrintPreviewDialog1.ShowDialog() End Sub Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage 'print grid Dim morepages As Boolean = PrintC.Print(e.Graphics) If (morepages) Then e.HasMorePages = True End If End Sub End Class End Namespace This is how data looks in DataGrid (that's perfect)... and here is how it looks when I click PrintPreview. (I don't want the time to appear there, the "12:00:00" part. in database the date is stored as Short Date (10-Dec-12) Can somebody suggest a way around that? Imports System Imports System.Windows.Forms Imports System.Drawing Imports System.Drawing.Printing Imports System.Collections Imports System.Data Namespace Print Public Class PrinterClass '//clone of Datagrid Dim PrintGrid As Grid '//printdocument for initial printer settings Private PrintDoc As PrintDocument '//defines whether the grid is ordered right to left Private bRightToLeft As Boolean '//Current Top Private CurrentY As Single = 0 '//Current Left Private CurrentX As Single = 0 '//CurrentRow to print Private CurrentRow As Integer = 0 '//Page Counter Public PageCounter As Integer = 0 '/// <summary> '/// Constructor Class '/// </summary> '/// <param name="pdocument"></param> '/// <param name="dgrid"></param> Public Sub New(ByVal pdocument As PrintDocument, ByVal dgrid As DataGrid) 'MyBase.new() PrintGrid = New Grid(dgrid) PrintDoc = pdocument '//The grid columns are right to left bRightToLeft = dgrid.RightToLeft = RightToLeft.Yes '//init CurrentX and CurrentY CurrentY = pdocument.DefaultPageSettings.Margins.Top CurrentX = pdocument.DefaultPageSettings.Margins.Left End Sub Public Function Print(ByVal g As Graphics, ByRef currentX As Single, ByRef currentY As Single) As Boolean '//use predefined area currentX = currentX currentY = currentY PrintHeaders(g) Dim Morepages As Boolean = PrintDataGrid(g) currentY = currentY currentX = currentX Return Morepages End Function Public Function Print(ByVal g As Graphics) As Boolean CurrentX = PrintDoc.DefaultPageSettings.Margins.Left CurrentY = PrintDoc.DefaultPageSettings.Margins.Top PrintHeaders(g) Return PrintDataGrid(g) End Function '/// <summary> '/// Print the Grid Headers '/// </summary> '/// <param name="g"></param> Private Sub PrintHeaders(ByVal g As Graphics) Dim sf As StringFormat = New StringFormat '//if we want to print the grid right to left If (bRightToLeft) Then CurrentX = PrintDoc.DefaultPageSettings.PaperSize.Width - PrintDoc.DefaultPageSettings.Margins.Right sf.FormatFlags = StringFormatFlags.DirectionRightToLeft Else CurrentX = PrintDoc.DefaultPageSettings.Margins.Left End If Dim i As Integer For i = 0 To PrintGrid.Columns - 1 '//set header alignment Select Case (CType(PrintGrid.Headers.GetValue(i), Header).Alignment) Case HorizontalAlignment.Left 'left sf.Alignment = StringAlignment.Near Case HorizontalAlignment.Center sf.Alignment = StringAlignment.Center Case HorizontalAlignment.Right sf.Alignment = StringAlignment.Far End Select '//advance X according to order If (bRightToLeft) Then '//draw the cell bounds (lines) and back color g.FillRectangle(New SolidBrush(PrintGrid.HeaderBackColor), CurrentX - PrintGrid.Headers(i).Width, CurrentY, PrintGrid.Headers(i).Width, PrintGrid.Headers(i).Height) g.DrawRectangle(New Pen(PrintGrid.LineColor), CurrentX - PrintGrid.Headers(i).Width, CurrentY, PrintGrid.Headers(i).Width, PrintGrid.Headers(i).Height) '//draw the cell text g.DrawString(PrintGrid.Headers(i).CText, PrintGrid.Headers(i).Font, New SolidBrush(PrintGrid.HeaderForeColor), New RectangleF(CurrentX - PrintGrid.Headers(i).Width, CurrentY, PrintGrid.Headers(i).Width, PrintGrid.Headers(i).Height), sf) '//next cell CurrentX -= PrintGrid.Headers(i).Width Else '//draw the cell bounds (lines) and back color g.FillRectangle(New SolidBrush(PrintGrid.HeaderBackColor), CurrentX, CurrentY, PrintGrid.Headers(i).Width, PrintGrid.Headers(i).Height) g.DrawRectangle(New Pen(PrintGrid.LineColor), CurrentX, CurrentY, PrintGrid.Headers(i).Width, PrintGrid.Headers(i).Height) '//draw the cell text g.DrawString(PrintGrid.Headers(i).CText, PrintGrid.Headers(i).Font, New SolidBrush(PrintGrid.HeaderForeColor), New RectangleF(CurrentX, CurrentY, PrintGrid.Headers(i).Width, PrintGrid.Headers(i).Height), sf) '//next cell CurrentX += PrintGrid.Headers(i).Width End If Next '//reset to beginning If (bRightToLeft) Then '//right align CurrentX = PrintDoc.DefaultPageSettings.PaperSize.Width - PrintDoc.DefaultPageSettings.Margins.Right Else '//left align CurrentX = PrintDoc.DefaultPageSettings.Margins.Left End If '//advance to next row CurrentY = CurrentY + CType(PrintGrid.Headers.GetValue(0), Header).Height End Sub Private Function PrintDataGrid(ByVal g As Graphics) As Boolean Dim sf As StringFormat = New StringFormat PageCounter = PageCounter + 1 '//if we want to print the grid right to left If (bRightToLeft) Then CurrentX = PrintDoc.DefaultPageSettings.PaperSize.Width - PrintDoc.DefaultPageSettings.Margins.Right sf.FormatFlags = StringFormatFlags.DirectionRightToLeft Else CurrentX = PrintDoc.DefaultPageSettings.Margins.Left End If Dim i As Integer For i = CurrentRow To PrintGrid.Rows - 1 Dim j As Integer For j = 0 To PrintGrid.Columns - 1 '//set cell alignment Select Case (PrintGrid.Cell(i, j).Alignment) '//left Case HorizontalAlignment.Left sf.Alignment = StringAlignment.Near Case HorizontalAlignment.Center sf.Alignment = StringAlignment.Center '//right Case HorizontalAlignment.Right sf.Alignment = StringAlignment.Far End Select '//advance X according to order If (bRightToLeft) Then '//draw the cell bounds (lines) and back color g.FillRectangle(New SolidBrush(PrintGrid.BackColor), CurrentX - PrintGrid.Cell(i, j).Width, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height) g.DrawRectangle(New Pen(PrintGrid.LineColor), CurrentX - PrintGrid.Cell(i, j).Width, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height) '//draw the cell text g.DrawString(PrintGrid.Cell(i, j).CText, PrintGrid.Cell(i, j).Font, New SolidBrush(PrintGrid.ForeColor), New RectangleF(CurrentX - PrintGrid.Cell(i, j).Width, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height), sf) '//next cell CurrentX -= PrintGrid.Cell(i, j).Width Else '//draw the cell bounds (lines) and back color g.FillRectangle(New SolidBrush(PrintGrid.BackColor), CurrentX, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height) g.DrawRectangle(New Pen(PrintGrid.LineColor), CurrentX, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height) '//draw the cell text '//Draw text by alignment g.DrawString(PrintGrid.Cell(i, j).CText, PrintGrid.Cell(i, j).Font, New SolidBrush(PrintGrid.ForeColor), New RectangleF(CurrentX, CurrentY, PrintGrid.Cell(i, j).Width, PrintGrid.Cell(i, j).Height), sf) '//next cell CurrentX += PrintGrid.Cell(i, j).Width End If Next '//reset to beginning If (bRightToLeft) Then '//right align CurrentX = PrintDoc.DefaultPageSettings.PaperSize.Width - PrintDoc.DefaultPageSettings.Margins.Right Else '//left align CurrentX = PrintDoc.DefaultPageSettings.Margins.Left End If '//advance to next row CurrentY += PrintGrid.Cell(i, 0).Height CurrentRow += 1 '//if we are beyond the page margin (bottom) then we need another page, '//return true If (CurrentY > PrintDoc.DefaultPageSettings.PaperSize.Height - PrintDoc.DefaultPageSettings.Margins.Bottom) Then Return True End If Next Return False End Function End Class End Namespace

    Read the article

  • How to programmatically change a data cell of Ms Access using VB.Net?

    - by manuel
    I have a Microsoft Access database file connected to VB.NET. In the database table, I have a 'No.' and a 'Status' column. Then I have a textbox where I can input an integer. I also have a button, which will change the data cell in 'Status' where 'No.' = textbox.Text(), when I click it. Let's say I want the 'Status' cell to be changed to "Low". What codes should I put in the button_Click event handler? Here is the codes I used to retrieve and display the database table. Public Class theForm Dim con As New OleDb.OleDbConnection Dim ds As New DataSet Dim daTitles As OleDb.OleDbDataAdapter Private Sub theForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|\db1.mdb" con.Open() daTitles = New OleDb.OleDbDataAdapter("SELECT * FROM Titles", con) daTitles.Fill(ds, "Titles") DataGridView1.DataSource = ds.Tables("Titles") DataGridView1.AutoResizeColumns() End Sub

    Read the article

  • Delete a Row from a DataGridView given its index

    - by Ruben Trancoso
    My DataGridView is a single line selection and theres a rowEnter Event where I get the line index every time the selected line changes. private void rowEnter(object sender, DataGridViewCellEventArgs e) { currentRowIndex = e.RowIndex; } when I press a delete button I use the same index to delete the row myDataSet.Avaliado.Rows[currentRowIndex].Delete(); avaliadoTableAdapter.Update(myDataSet.Avaliado); it works fine if no column in the DataGridView is sorted, otherwise a get an error. What should be the way to know the row index in the dataset that corresponds to the rowindex from the DataGridView?

    Read the article

  • How can I dynamically inject code into event handlers in Delphi?

    - by mjustin
    For debugging / performance tests I would like to dynamically add logging code to all event handlers of components of a given type. For example, for all Dataset components located ona TDatamodule, I would like to add some code for the BeforeOpen and the AfterOpen event to store the start and end time and send a line to a logger with the elapsed time in the AfterOpen event. I would prefer to do this dynamically (no component subclassing), so that I can add this to all existing datamodules and forms with minimal effort only when needed. Iterating all components and filtering by their type is easy, but for the components which already have event handlers assigned, I need a way to store the existing event handlers, and assign a new modified event handler which first does the logging and then will invoke the original code which was already present. Is there a design pattern which can be applied, or even some example code which shows how to implement this in Delphi?

    Read the article

  • Exporting data from a gridview to different excel worksheets

    - by Alex
    I am binding data from a dataset to a grid and exporting data from the grid to an excel.if the the number of items in the grid is greater than 50000,an error message is displayed. So i want to split the data and display it in different worksheets in excel.(Am working in a web application) using this code for exporting to excel gvExcel.DataSource = DTS; gvExcel.DataBind(); Response.AddHeader("content-disposition", "attachment; filename= filename.xls"); Response.ContentType = "application/excel"; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); gvExcel.RenderControl(htw); // Style is added dynamically Response.Write(style); Response.Write(sw.ToString()); Response.End(); Can anyone help me on this??

    Read the article

  • How do I display non-normalized data in a hierarchical structure?

    - by rofly
    My issue is that I want to display data in a hierarchal structure as so: Democrat County Clerk Candidate 1 Candidate 2 Magistrate Candidate 1 Candidate 2 Candidate 3 But I'm retrieving the dataset like this: Party | Office | Candidate Democrat | County Clerk | Candidate 1 Democrat | County Clerk | Candidate 2 Democrat | Magistrate | Candidate 1 Democrat | Magistrate | Candidate 2 Democrat | Magistrate | Candidate 3 I planned on using nested repeaters, but I need a distinct value of Party, and then distinct values of office name within that party in order to do it. Are there any .NET functions to easily do what I'm attempting to? Would there be a better way of displaying the information other than repeaters? Thanks in advance!

    Read the article

  • How can I manipulate the strip text of facet plots in ggplot2?

    - by briandk
    I'm wondering how I can manipulate the size of strip text in facetted plots. My question is similar to a question on plot titles, but I'm specifically concerned with manipulating not the plot title but the text that appears in facet titles (strip_h). As an example, consider the mpg dataset. library(ggplot2) qplot(hwy, cty, data = mpg) + facet_grid( . ~ manufacturer) The resulting output produces some facet titles that don't fit in the strip. I'm thinking there must be a way to use grid to deal with the strip text. But I'm still a novice and wasn't sure from the grid appendix in Hadley's book how, precisely, to do it. Also, I was afraid if I did it wrong it would break my washing machine, since I believe all technology is connected through The Force :-( Many thanks in advance.

    Read the article

  • Pull datasets from DB and manipulate into separate arrays

    - by dresdin
    My DB has four fields, date:date, morning:integer, afternoon:integer, evening:integer. Google charts needs the data split into one array per dataset (example below). What's the best way to do this? ['Day', 'Morning', 'Afternoon', 'Evening'], ['06/27/13', 1000, 400 234], ['06/28/13', 1170, 460 275], ['06/29/13', 660, 1120 377], ['06/30/13', 1030, 540 934] I've tried this without much luck: var data = google.visualization.arrayToDataTable([ <% @todo.each do |t| %> ['Day', 'Morning', 'Afternoon', 'Evening'], [<%= t.date.strftime("%m/%d/%y") %>, <%= t.morning %>, <%= t.afternoon %>, <%= t.evening %>] <% end %> ]);

    Read the article

  • SQL Server union selects built dynamically from list of words

    - by Adam Tuttle
    I need to count occurrence of a list of words across all records in a given table. If I only had 1 word, I could do this: select count(id) as NumRecs where essay like '%word%' But my list could be hundreds or thousands of words, and I don't want to create hundreds or thousands of sql requests serially; that seems silly. I had a thought that I might be able to create a stored procedure that would accept a comma-delimited list of words, and for each word, it would run the above query, and then union them all together, and return one huge dataset. (Sounds reasonable, right? But I'm not sure where to start with that approach...) Short of some weird thing with union, I might try to do something with a temp table -- inserting a row for each word and record count, and then returning select * from that temp table. If it's possible with a union, how? And does one approach have advantages (performance or otherwise) over the other?

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >