Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 48/286 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • Equalize column javascript not working in Chrome

    - by alimango
    Hi, I'm using this mootools javascript snippet to equalize the height of my columns: window.addEvent('domready', function() { var columns = $$('.equalize'); var max_height = 0; columns.each(function(item) { max_height = Math.max(max_height, item.getSize().y); }); columns.setStyle('height', max_height); }); Problem is it's not working properly on Chrome. It's getting the minimum height of the 2 columns instead of getting the maximum. What seems to be the problem and how do I fix it? Thanks in advance!

    Read the article

  • RODBC sqlSave and column names

    - by waanders
    I've a question about using sqlSave. How maps RODBC data in the data frame to the database table columns? If I've a table with columns X and Y and a data frame with columns X and Y, RODBC puts X into X and Y into Y (I found out by trail-and-error). But can I explicitly tell R how to map data.frame columns to database table columns, like put A in X and B in Y. I'm rather new to R and think the RODBC manual is a bit cryptic. Nor can I find an example on the internet.

    Read the article

  • Why the difference in speed?

    - by AngryHacker
    Consider this code: function Foo(ds as OtherDLL.BaseObj) dim lngRowIndex as long dim lngColIndex as long for lngRowIndex = 1 to ubound(ds.Data, 2) for lngColIndex = 1 to ds.Columns.Count Debug.Print ds.Data(lngRowIndex, lngColIndex) next next end function OK, a little context. Parameter ds is of type OtherDLL.BaseObj which is defined in a referenced ActiveX DLL. ds.Data is a variant 2-dimensional array (one dimension carries the data, the other one carries the column index. ds.Columns is a Collection of columns in 'ds.Data`. Assuming there are at least 400 rows of data and 25 columns, this code takes about 15 seconds to run on my machine. Kind of unbelievable. However if I copy the variant array to a local variable, so: function Foo(ds as OtherDLL.BaseObj) dim lngRowIndex as long dim lngColIndex as long dim v as variant v = ds.Data for lngRowIndex = 1 to ubound(v, 2) for lngColIndex = 1 to ds.Columns.Count Debug.Print v(lngRowIndex, lngColIndex) next next end function the entire thing processes in barely any noticeable time (basically close to 0). Why?

    Read the article

  • Cant free memory.

    - by atch
    In code: int a[3][4] = {1,2,3,4, 5,6,7,8, 9,10,11,12}; template<class T, int row, int col> void invert(T a[row][col]) { T* columns = new T[col]; T* const free_me = columns; for (int i = 0; i < col; ++i) { for (int j = 0; j < row; ++j) { *columns = a[j][i]; ++columns;//SOMETIMES VALUE IS 0 } } delete[] free_me;//I'M GETTING ERROR OF HEAP ABUSE IN THIS LINE } int main(int argc, char* argv[]) { invert<int,3,4>(a); } I've observed that while iterating, value of variable columns equals zero and I think thats the problem. Thanks for your help.

    Read the article

  • Right way to implement a n-to-m related

    - by ThreeFingerMark
    Hello, this is a part from my database structure: Table: Item Columns: ItemID, Title, Content, Price Table: Tag Columns: TagID, Title Table: ItemTag Columns: ItemID, TagID Table: Image Columns: ImageID, Path, Size, UploadDate Table: ItemImage Columns: ItemID, ImageID The items can have more than one image so i have a extra table "Image" and map this images to an items. I see now a problem with this structure. Before i can add Images i must enter an item. My question is now. Is this structure a good way to solve my problem with many images / tags for one item? Thank you

    Read the article

  • View changes nvarchars to varchars in SQL Server 2008

    - by Traples
    I have a view in a SQL Server 2008 db that simply exposes about 20 fields of one table to be consumed via ODBC to a client. When I tried to replicate this view in another database, the client could not consume the data source. Then I noticed some weirdness. The columns in the view are shown, in SQL Server Management Studio, to be varchar(100), while the columns in the table are defined as nvarchar(100). There are no CAST or CONVERT statements in the view, it is a simple SELECT statement. Example: Table - Columns: Desc1 (nvarchar(100), null) View - SELECT TOP 100 PERCENT Desc1 FROM... Columns: Desc1 (varchar(100), null) Any ideas why the columns are defined as varchar in the view instead of nvarchar?

    Read the article

  • blackberry development problem?

    - by user188391
    i want to create this type of grid field can any one guide me? import net.rim.device.api.ui.Field; import net.rim.device.api.ui.Manager; public class GridFieldManager extends Manager { private int[] columnWidths; private int columns; private int allRowHeight = -1; public GridFieldManager(int columns, long style) { super(style); this.columns = columns; } public GridFieldManager(int[] columnWidths, long style) { super(style); this.columnWidths = columnWidths; this.columns = columnWidths.length; } public GridFieldManager(int[] columnWidths, int rowHeight, long style) { this(columnWidths, style); this.allRowHeight = rowHeight; } protected boolean navigationMovement(int dx, int dy, int status, int time) { int focusIndex = getFieldWithFocusIndex(); while(dy > 0) { focusIndex += columns; if (focusIndex >= getFieldCount()) { return false; // Focus moves out of this manager } else { Field f = getField(focusIndex); if (f.isFocusable()) { // Only move the focus onto focusable fields f.setFocus(); dy--; } } } while(dy < 0) { focusIndex -= columns; if (focusIndex < 0) { return false; } else { Field f = getField(focusIndex); if (f.isFocusable()) { f.setFocus(); dy++; } } } while(dx > 0) { focusIndex ++; if (focusIndex >= getFieldCount()) { return false; } else { Field f = getField(focusIndex); if (f.isFocusable()) { f.setFocus(); dx--; } } } while(dx < 0) { focusIndex --; if (focusIndex < 0) { return false; } else { Field f = getField(focusIndex); if (f.isFocusable()) { f.setFocus(); dx++; } } } return true; } protected void sublayout(int width, int height) { int y = 0; if (columnWidths == null) { columnWidths = new int[columns]; for(int i = 0; i < columns; i++) { columnWidths[i] = width/columns; } } Field[] fields = new Field[columnWidths.length]; int currentColumn = 0; int rowHeight = 0; for(int i = 0; i < getFieldCount(); i++) { fields[currentColumn] = getField(i); layoutChild(fields[currentColumn], columnWidths[currentColumn], height-y); if (fields[currentColumn].getHeight() > rowHeight) { rowHeight = fields[currentColumn].getHeight(); } currentColumn++; if (currentColumn == columnWidths.length || i == getFieldCount()-1) { int x = 0; if (this.allRowHeight >= 0) { rowHeight = this.allRowHeight; } for(int c = 0; c < currentColumn; c++) { long fieldStyle = fields[c].getStyle(); int fieldXOffset = 0; long fieldHalign = fieldStyle & Field.FIELD_HALIGN_MASK; if (fieldHalign == Field.FIELD_RIGHT) { fieldXOffset = columnWidths[c] - fields[c].getWidth(); } else if (fieldHalign == Field.FIELD_HCENTER) { fieldXOffset = (columnWidths[c]-fields[c].getWidth())/2; } int fieldYOffset = 0; long fieldValign = fieldStyle & Field.FIELD_VALIGN_MASK; if (fieldValign == Field.FIELD_BOTTOM) { fieldYOffset = rowHeight - fields[c].getHeight(); } else if (fieldValign == Field.FIELD_VCENTER) { fieldYOffset = (rowHeight-fields[c].getHeight())/2; } setPositionChild(fields[c], x+fieldXOffset, y + fieldYOffset); x += columnWidths[c]; } currentColumn = 0; y += rowHeight; } if (y >= height) { break; } } int totalWidth = 0; for(int i = 0; i < columnWidths.length; i++) { totalWidth += columnWidths[i]; } setExtent(totalWidth, Math.min(y, height)); } }

    Read the article

  • averaging matrix efficiently

    - by user248237
    in Python, given an n x p matrix, e.g. 4 x 4, how can I return a matrix that's 4 x 2 that simply averages the first two columns and the last two columns for all 4 rows of the matrix? e.g. given: a = array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]) return a matrix that has the average of a[:, 0] and a[:, 1] and the average of a[:, 2] and a[:, 3]. I want this to work for an arbitrary matrix of n x p assuming that the number of columns I am averaging of n is obviously evenly divisible by n. let me clarify: for each row, I want to take the average of the first two columns, then the average of the last two columns. So it would be: 1 + 2 / 2, 3 + 4 / 2 <- row 1 of new matrix 5 + 6 / 2, 7 + 8 / 2 <- row 2 of new matrix, etc. which should yield a 4 by 2 matrix rather than 4 x 4. thanks.

    Read the article

  • How to handle added input data colums without having to maintain multiple versions of SSIS packages?

    - by GLFelger
    I’m writing to solicit ideas for a solution to an upcoming problem. The product that provides data to our ETL process currently has multiple versions. Our clients are all using some version of the product, but not all use the same version and they will not all be upgraded at the same time. As new versions of the product are rolled out, the most common change is to add new data columns. Columns being dropped or renamed may happen occasionally, but our main focus right now is how to handle new columns being added. The problem that we want to address is how to handle the data for clients who use an older version of the product. If we don’t account for the new columns in our SSIS packages, then the data in those columns for clients using an older product version will not be processed. What we want to avoid is having to maintain a separate version of the SSIS packages for each version of the product. Has anyone successfully implemented a solution for this situation?

    Read the article

  • Normalize database or not? Read only MyISAM table, performance is the main priority (MySQL)

    - by hello
    I'm importing data to a future database that will have one, static MyISAM table (will only be read from). I chose MyISAM because as far as I understand it's faster for my requirements (I'm not very experienced with MySQL / SQL at all). That table will have various columns such as ID, Name, Gender, Phone, Status... and Country, City, Street columns. Now the question is, should I create tables (e.g Country: Country_ID, Country_Name) for the last 3 columns and refer to them in the main table by ID (normalize...[?]), or just store them as VARCHAR in the main table (having duplicates, obviously)? My primary concern is speed - since the table won't be written into, data integrity is not a priority. The only actions will be selecting a specific row or searching for rows that much a certain criteria. Would searching by the Country, City and/or Street columns (and possibly other columns in the same search) be faster if I simply use VARCHAR?

    Read the article

  • July, the 31 Days of SQL Server DMO’s – Day 23 (sys.dm_db_index_usage_stats)

    - by Tamarick Hill
    The sys.dm_db_index_usage_stats Dynamic Management View is used to return usage information about the various indexes on your SQL Server instance. Let’s have a look at this DMV against our AdventureWorks2012 database so we can examine the information returned. SELECT * FROM sys.dm_db_index_usage_stats WHERE database_id = db_id('AdventureWorks2012') The first three columns in the result set represent the database_id, object_id, and index_id of a given row. You can join these columns back to other system tables to extract the actual database, object, and index names. The next four columns are probably the most beneficial columns within this DMV. First, the user_seeks column represents the number of times that a user query caused a seek operation against a particular index. The user_scans column represents how many times a user query caused a scan operation on a particular index. The user_lookups column represents how many times an index was used to perform a lookup operation. The user_updates column refers to how many times an index had to be updated due to a write operation that effected a particular index. The last_user_seek, last_user_scan, last_user_lookup, and last_user_update columns provide you with DATETIME information about when the last user scan, seek, lookup, or update operation was performed. The remaining columns in the result set are the same as the ones we previously discussed, except instead of the various operations being generated from user requests, they are generated from system background requests. This is an extremely useful DMV and one of my favorites when it comes to Index Maintenance. As we all know, indexes are extremely beneficial with improving the performance of your read operations. But indexes do have a downside as well. Indexes slow down the performance of your write operations, and they also require additional resources for storage. For this reason, in my opinion, it is important to regularly analyze the indexes on your system to make sure the indexes you have are being used efficiently. My AdventureWorks2012 database is only used for demonstrating or testing things, so I dont have a lot of meaningful information here, but for a Production system, if you see an index that is never getting any seeks, scans, or lookups, but is constantly getting a ton of updates, it more than likely would be a good candidate for you to consider removing. You would not be getting much benefit from the index, but yet it is incurring a cost on your system due to it constantly having to be updated for your write operations, not to mention the additional storage it is consuming. You should regularly analyze your indexes to ensure you keep your database systems as efficient and lean as possible. One thing to note is that these DMV statistics are reset every time SQL Server is restarted. Therefore it would not be a wise idea to make decisions about removing indexes after a Server Reboot or a cluster roll. If you restart your SQL Server instances frequently, for example if you schedule weekly/monthly cluster rolls, then you may not capture indexes that are being used for weekly/monthly reports that run for business users. And if you remove them, you may have some upset people at your desk on Monday morning. If you would like to begin analyzing your indexes to possibly remove the ones that your system is not using, I would recommend building a process to load this DMV information into a table on scheduled basis, depending on how frequently you perform an operation that would reset these statistics, then you can analyze the data over a period of time to get a more accurate view of what indexes are really being used and which ones or not. For more information about this DMV, please see the below Books Online link: http://msdn.microsoft.com/en-us/library/ms188755.aspx Follow me on Twitter @PrimeTimeDBA

    Read the article

  • Stairway to PowerPivot and DAX - Level 2: The DAX COUNTROWS() and FILTER() Functions

    Bill Pearson, business intelligence architect and author, exposes the DAX COUNTROWS() and FILTER() functions, while generally exploring, comparing and contrasting the nature and operation of calculated columns and calculated measures, in the second Level of our Stairway to PowerPivot and DAX series. 12 essential tools for database professionalsThe SQL Developer Bundle contains 12 tools designed with the SQL Server developer and DBA in mind. Try it now.

    Read the article

  • SQL SERVER – Finding Different ColumnName From Almost Identitical Tables

    - by pinaldave
    I have mentioned earlier on this blog that I love social media – Facebook and Twitter. I receive so many interesting questions that sometimes I wonder how come I never faced them in my real life scenario. Well, let us see one of the similar situation. Here is one of the questions which I received on my social media handle. “Pinal, I have a large database. I did not develop this database but I have inherited this database. In our database we have many tables but all the tables are in pairs. We have one archive table and one current table. Now here is interesting situation. For a while due to some reason our organization has stopped paying attention to archive data. We did not archive anything for a while. If this was not enough we  even changed the schema of current table but did not change the corresponding archive table. This is now becoming a huge huge problem. We know for sure that in current table we have added few column but we do not know which ones. Is there any way we can figure out what are the new column added in the current table and does not exist in the archive tables? We cannot use any third party tool. Would you please guide us?” Well here is the interesting example of how we can use sys.column catalogue views and get the details of the newly added column. I have previously written about EXCEPT over here which is very similar to MINUS of Oracle. In following example we are going to create two tables. One of the tables has extra column. In our resultset we will get the name of the extra column as we are comparing the catalogue view of the column name. USE AdventureWorks2012 GO CREATE TABLE ArchiveTable (ID INT, Col1 VARCHAR(10), Col2 VARCHAR(100), Col3 VARCHAR(100)); CREATE TABLE CurrentTable (ID INT, Col1 VARCHAR(10), Col2 VARCHAR(100), Col3 VARCHAR(100), ExtraCol INT); GO -- Columns in ArchiveTable but not in CurrentTable SELECT name ColumnName FROM sys.columns WHERE OBJECT_NAME(OBJECT_ID) = 'ArchiveTable' EXCEPT SELECT name ColumnName FROM sys.columns WHERE OBJECT_NAME(OBJECT_ID) = 'CurrentTable' GO -- Columns in CurrentTable but not in ArchiveTable SELECT name ColumnName FROM sys.columns WHERE OBJECT_NAME(OBJECT_ID) = 'CurrentTable' EXCEPT SELECT name ColumnName FROM sys.columns WHERE OBJECT_NAME(OBJECT_ID) = 'ArchiveTable' GO DROP TABLE ArchiveTable; DROP TABLE CurrentTable; GO The above query will return us following result. I hope this solves the problems. It is not the most elegant solution ever possible but it works. Here is the puzzle back to you – what native T-SQL solution would you have provided in this situation? Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL System Table, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • SharePoint: Numeric/Integer Site Column (Field) Types

    - by CharlesLee
    What field type should you use when creating number based site columns as part of a SharePoint feature? Windows SharePoint Services 3.0 provides you with an extensible and flexible method of developing and deploying Site Columns and Content Types (both of which are required for most SharePoint projects requiring list or library based data storage) via the feature framework (more on this in my next full article.) However there is an interesting behaviour when working with a column or field which is required to hold a number, which I thought I would blog about today. When creating Site Columns in the browser you get a nice rich UI in order to choose the properties of this field: However when you are recreating this as a feature defined in CAML (Collaborative Application Mark-up Language), which is a type of XML (more on this in my article) then you do not get such a rich experience.  You would need to add something like this to the element manifest defined in your feature: <Field SourceID="http://schemas.microsoft.com/sharepoint/3.0"        ID="{C272E927-3748-48db-8FC0-6C7B72A6D220}"        Group="My Site Columns"        Name="MyNumber"        DisplayName="My Number"        Type="Numeric"        Commas="FALSE"        Decimals="0"        Required="FALSE"        ReadOnly="FALSE"        Sealed="FALSE"        Hidden="FALSE" /> OK, its not as nice as the browser UI but I can deal with this. Hang on. Commas="FALSE" and yet for my number 1234 I get 1,234.  That is not what I wanted or expected.  What gives? The answer lies in the difference between a type of "Numeric" which is an implementation of the SPFieldNumber class and "Integer" which does not correspond to a given SPField class but rather represents a positive or negative integer.  The numeric type does not respect the settings of Commas or NegativeFormat (which defines how to display negative numbers.)  So we can set the Type to Integer and we are good to go.  Yes? Sadly no! You will notice at this point that if you deploy your site column into SharePoint something has gone wrong.  Your site column is not listed in the Site Column Gallery.  The deployment must have failed then?  But no, a quick look at the site columns via the API reveals that the column is there.  What new evil is this?  Unfortunately the base type for integer fields has this lovely attribute set on it: UserCreatable = FALSE So WSS 3.0 accordingly hides your field in the gallery as you cannot create fields of this type. However! You can use them in content types just like any other field (except not in the browser UI), and if you add them to the content type as part of your feature then they will show up in the UI as a field on that content type.  Most of the time you are not going to be too concerned that your site columns are not listed in the gallery as you will know that they are there and that they are still useable. So not as bad as you thought after all.  Just a little quirky.  But that is SharePoint for you.

    Read the article

  • Edit/Access data from a CheckBox column in an ASPX:GridView - c#

    - by Endo
    Hi, I have a GridView to which I bind a dataTable I manually create. Both the GridView and the dataTable contain 2 columns, Name and isBusy. My GridView looks like this <Columns> <asp:BoundField HeaderText="Name" DataField="Name" SortExpression="Name"> </asp:BoundField> <asp:CheckBoxField DataField="isBusy" HeaderText="Busy" SortExpression="isBusy" /> </Columns> That works fine, except that the Busy column is non-editable unless you set a specific row to edit mode. I require the entire column of checkboxes to be checkable. So I converted the column to a template, and so the columns look like this: <Columns> <asp:BoundField HeaderText="Name" DataField="Name" SortExpression="Name"> </asp:BoundField> <asp:TemplateField HeaderText="Busy" SortExpression="isBusy"> <ItemTemplate> <asp:CheckBox ID="isBusy" runat="server" Checked='<%# Eval("isBusy") %>' oncheckedchanged="CheckBoxBusy_CheckedChanged" /> </ItemTemplate> </asp:TemplateField> </Columns> Now, this throws an error at runtime, saying System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="App_Web_zzjsqlrr" StackTrace: at ASP.proyectos_aspx.__DataBinding__control24(Object sender, EventArgs e) in c:\Proyect\Users.aspx:line 189 at System.Web.UI.Control.OnDataBinding(EventArgs e) at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.Control.DataBindChildren() InnerException: Any idea why this is happening? The next step I would need is to know how to set and get a checkbox's state (haven't been able to find how to manually check a checkbox). I appreciate very much any help.

    Read the article

  • how convert DataTable to List<String> in C#

    - by Jitendra Jadav
    Hello Everyone .. I am using C# Linq now I am converting DataTable to List and I am getting stuck... give me right direction thanks.. private void treeview1_Expanded(object sender, RoutedEventArgs e) { coa = new List<string>(); //coa = (List<string>)Application.Current.Properties["CoAFull"]; HMDAC.Hmclientdb db = new HMDAC.Hmclientdb(HMBL.Helper.GetDBPath()); var data = (from a in db.CoA where a.ParentId == 0 && a.Asset == true select new { a.Asset, a.Category, a.CoAName, a.Hide, a.Recurring, a.TaxApplicable }); DataTable dtTable = new DataTable(); dtTable.Columns.Add("Asset", typeof(bool)); dtTable.Columns.Add("Category", typeof(string)); dtTable.Columns.Add("CoAName", typeof(string)); dtTable.Columns.Add("Hide", typeof(bool)); dtTable.Columns.Add("Recurring", typeof(bool)); dtTable.Columns.Add("TaxApplicable", typeof(bool)); if (data.Count() > 0) { foreach (var item in data) { DataRow dr = dtTable.NewRow(); dr["Asset"] = item.Asset; dr["Category"] = item.Category; dr["CoAName"] = item.CoAName; dr["Hide"] = item.Hide; dr["Recurring"] = item.Recurring; dr["TaxApplicable"] = item.TaxApplicable; dtTable.Rows.Add(dr); } } coa = dtTable; }

    Read the article

  • How i can add border to ListViewItem, ListView in GridView mode.

    - by Andrew
    Hello! I want to have a border around ListViewItem (row in my case). ListView source and columns generated during Runtime. In XAML i have this structure: <ListView Name="listViewRaw"> <ListView.View> <GridView> </GridView> </ListView.View> </ListView> During Runtime i bind listview to DataTable, adding necessary columns and bindings: var view = (listView.View as GridView); view.Columns.Clear(); for (int i = 0; i < table.Columns.Count; i++) { GridViewColumn col = new GridViewColumn(); col.Header = table.Columns[i].ColumnName; col.DisplayMemberBinding = new Binding(string.Format("[{0}]", i.ToString())); view.Columns.Add(col); } listView.CoerceValue(ListView.ItemsSourceProperty); listView.DataContext = table; listView.SetBinding(ListView.ItemsSourceProperty, new Binding()); So i want to add border around each row, and set border behavior (color etc) with DataTriggers (for example if value in 1st column = "Visible", set border color to black). Can i put border through DataTemplate in ItemTemplate? I know solution, where you manipulate with CellTemplates, but i don't really like it. I want something like this if this even possible. <DataTemplate> <Border Name="Border" BorderBrush="Transparent" BorderThickness="2"> <ListViewItemRow><!-- Put my row here, but i ll know about table structure only during runtime --></ListViewItemRow> </Border> </DataTemplate>

    Read the article

  • Newbie database index question

    - by RenderIn
    I have a table with multiple indexes, several of which duplicate the same columns: Index 1 columns: X, B, C, D Index 2 columns: Y, B, C, D Index 3 columns: Z, B, C, D I'm not very knowledgeable on indexing in practice, so I'm wondering if somebody can explain why X, Y and Z were paired with these same columns. B is an effective date. C is a semi-unique key ID for this table for a specific effective date B. D is a sequence that identifies the priority of this record for the identifier C. Why not just create 6 indexes, one for each X, Y, Z, B, C, D? I want to add an index to another column T, but in some contexts I'll only be querying on T alone while in others I will also be specifying the B, C and D columns... so should I create just one index like above or should I create one for T and one for (T, B, C, D)? I've not had as much luck as expected when googling for comprehensive coverage of indexing. Any resources where I can get a through explanation and lots of examples of B-tree indexing?

    Read the article

  • InvalidArgument=Value of '3' is not valid for 'rowIndex'

    - by Devendra Dwivedi
    Hi all This is my code It is working for if 1 terminal that is having 3 services but it is not working for more than 3 services when I do then I have got following error message: InvalidArgument=Value of '3' is not valid for 'rowIndex' I have so tired to find this problem but couldn't get any solutions. Anybody please help me. MySqlCommand command = new MySqlCommand("VTerminalsLoad");//Procedure MySqlDataAdapter terminalAdapter = this.Database.ExecuteCommand(command); terminalAdapter.Fill(dataSet, "Terminals"); command = new MySqlCommand("VTServicesLoad");//Procedure command.Parameters.Add(new MySqlParameter("pVesselID", 1)); MySqlDataAdapter serviceAdapter = this.Database.ExecuteCommand(command);//Return Adaptor serviceAdapter.Fill(dataSet, "Services"); DataColumn[] parentColumns = { dataSet.Tables[0].Columns["SerialNo"], dataSet.Tables[0].Columns["VesselID"], dataSet.Tables[0].Columns["TerminalID"] }; DataColumn[] childColumns = { dataSet.Tables[1].Columns["SerialNo"], dataSet.Tables[1].Columns["VesselID"], dataSet.Tables[1].Columns["TerminalID"] }; DataRelation relationTS = new DataRelation("TerminalsServices", parentColumns, childColumns); dataSet.Relations.Add(relationTS); //Parent Table ListTerminal.DataSource = dataSet; //ListTerminal Parent datagridview ListTerminal.DataMember = "Terminals"; //Child Table ListServices.DataSource = dataSet;// ListServices Child datagridview ListServices.DataMember = "Terminals.TerminalsServices";

    Read the article

  • Change column height as other column gets longer

    - by Infiniti Fizz
    Hi, I have tried a few things to solve this problem but I can't seem to get it working. The problem is that I have 2 columns as the main part of my website, right and left. On some pages, there is a lot of text in the left column, therefore it is very long, the problem is that the right column doesn't elongate with the left column. Both columns have the same background colour and a footer s displayed across the width of both columns after the columns finish. My first thought was to put both columns inside a div which would have the same background colour as them and therefore if the left column became 1500px long in total and the right column stayed at around 600px (due to the elements inside it) then this wouldn't show as the new, outer div would elongate along with the left column. But for some reason this didn't work. Could it be because the columns are floated? Does anyone have any other ideas? Here is the website (Obviously not finished yet): Beansheaf Hotel I have chosen a page where there is a lot of text in the left column so the problem is apparent. Thanks in advance, InfinitiFizz

    Read the article

  • Precision error on matrix multiplication

    - by Wam
    Hello all, Coding a matrix multiplication in my program, I get precision errors (inaccurate results for large matrices). Here's my code. The current object has data stored in a flattened array, row after row. Other matrix B has data stored in a flattened array, column after column (so I can use pointer arithmetic). protected double[,] multiply (IMatrix B) { int columns = B.columns; int rows = Rows; int size = Columns; double[,] result = new double[rows,columns]; for (int row = 0; row < rows; row++) { for (int col = 0; col < columns; col++) { unsafe { fixed (float* ptrThis = data) fixed (float* ptrB = B.Data) { float* mePtr = ptrThis + row*rows; float* bPtr = ptrB + col*columns; double value = 0.0; for (int i = 0; i < size; i++) { value += *(mePtr++) * *(bPtr++); } result[row, col] = value; } } } } } Actually, the code is a bit more complicated : I do the multiply thing for several chunks (so instead of having i from 0 to size, I go from localStart to localStop), then sum up the resulting matrices. My problem : for a big matrix I get precision error : NUnit.Framework.AssertionException: Error at (0,1) expected: <6.4209571409444209E+18> but was: <6.4207619776304906E+18> Any idea ?

    Read the article

  • CSS Design question, I've got myself completely turned around.

    - by Matt Dawdy
    Okay, I have a couple of other questions out there, but I think I'd better just ask from the beginning how you CSS experts would do this. Client's page is split into 2 rows -- header has some info, some aligned to left of page, some to right, some in the middle. This is currently done using a table. I'm fine with leaving this alone or changing it. My real question is that I need a page layout to handle the following: 2 columns - column on left is 200px, but can be "close" down to to 10px (not a slider, it's either 200 or 10 px). The column on the right needs to be as big as it needs to be -- which might be larger than the width of the page. When left column is "closed" then the right column slides over of course. Again, this right column might be 300px or it might be 4000 pixels (it's a reporting interface). Now, to add another wrinkle, SOME pages have 3 columns. The first 2 columns are each exactly 200px, and both can be "closed" down to 10 px each. But, the user may not close both columns, maybe just 1. Or none. Or both. The third column needs to act just like I described above, being able to be larger than the page width, and sliding over to take advantage of any of the "closed" left columns. Whew! I'm pretty confused as to how to go about this, as either I get it right but I can't scroll over to the right at all (overflow: hidden) and information is lost, or the right column jumps down below the left 2 columns and just looks plain stupid. My minimum browser requirements are IE8, FF3.5, Chrome and Safari (latest versions of all). Any and all pointers are gladly accepted.

    Read the article

  • Create serial number column in telerik mvc grid

    - by Jayaraj
    I could create a grid with telerik mvc <% Html.Telerik().Grid(Model) .Name("ProductGrid") .Columns(columns => { columns.Bound(h => h.ProductName).Width("34%"); columns.Bound(h => h.Description).Width("60%"); columns.Bound(h => h.ProductID).Format(Html.ImageLink("Edit", "Products", new { Id = "{0}" }, "/Content/images/icon_edit.gif", "", new { Id = "edit{0}" }, null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%"); columns.Bound(h => h.ProductID).Format(Html.ImageLink("Delete", "Products", new { Id = "{0}" }, "/Content/images/icon_delete.gif", "", new { onclick = string.Format("return confirm('Are you sure to delete this add on?');") },null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%"); }) .EnableCustomBinding(true) .DataBinding(databinding => databinding.Ajax().Select("_Index", "ProductGrid")) .Pageable(settings => settings.Total((int)ViewData["TotalPages"]) .PageSize(10)) .Sortable() .Render(); %> but I need to add a serial number column in telerik grid.How can i do this?

    Read the article

  • How to assign class property as display data memeber in datagridview

    - by KoolKabin
    hi guys, I am trying to display my data in datagridview. I created a class with different property and used its list as the datasource. it worked fine. but i got confused how to do that in case we have nested class. My Classes are as follows: class Category property UIN as integer property Name as string end class class item property uin as integer property name as string property mycategory as category end class my data list as follows: dim myDataList as list(of Item) = new List(of Item) myDataList.Add(new Item(1,"item1",new category(1,"cat1"))) myDataList.Add(new Item(2,"item2",new category(1,"cat1"))) myDataList.Add(new Item(3,"item3",new category(1,"cat1"))) myDataList.Add(new Item(4,"item4",new category(2,"cat2"))) myDataList.Add(new Item(5,"item5",new category(2,"cat2"))) myDataList.Add(new Item(6,"item6",new category(2,"cat2"))) Now I binded the datagridview control like: DGVMain.AutoGenerateColumns = False DGVMain.ColumnCount = 3 DGVMain.Columns(0).DataPropertyName = "UIN" DGVMain.Columns(0).HeaderText = "ID" DGVMain.Columns(1).DataPropertyName = "Name" DGVMain.Columns(1).HeaderText = "Name" DGVMain.Columns(2).DataPropertyName = "" **'here i want my category name** DGVMain.Columns(2).HeaderText = "category" DGVMain.datasource = myDataList DGVMain.refresh() I have tried using mycategory.name but it didn't worked. What can be done to get expected result? Is there any better idea other than this to accomplish the same task?

    Read the article

  • Problem using SQLDataReader with Sybase ASE

    - by John K.
    We're developing a reporting application that uses asp.net-mvc (.net 4). We connect through DDTEK.Sybase middleware to a Sybase ASE 12.5 database. We're having a problem pulling data into a datareader (from a stored procedure). The stored procedure computes values (approximately 50 columns) by doing sums, counts, and calling other stored procedures. The problem we're experiencing is... certain (maybe 5% of the columns) come back with NULL or 0. If we debug and copy the SQL statement being used for the datareader and run it inside another SQL tool we get all valid values for all columns. conn = new SybaseConnection { ConnectionString = ConfigurationManager.ConnectionStrings[ConnectStringName].ToString() }; conn.Open(); cmd = new SybaseCommand { CommandTimeout = cmdTimeout, Connection = conn, CommandText = mainSql }; reader = cmd.ExecuteReader(); // AT THIS POINT IMMEDIATELY AFTER THE EXECUTEREADER COMMAND // THE READER CONTAINS THE BAD (NULL OR 0) DATA FOR THESE COLUMNS. DataTable schemaTable = reader.GetSchemaTable(); // AT THIS POINT WE CAN VIEW THE DATATABLE FOR THE SCHEMA AND IT APPEARS CORRECT // THE COLUMNS THAT DON'T WORK HAVE SPECIFICATIONS IDENTICAL TO THE COLUMNS THAT DO WORK Has anyone had problems like this using Sybase and ADO? Thanks, John K.

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >