Search Results

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

Page 62/286 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • How would I design this table in SQL?

    - by RSharma
    I have a parent master table that is generic enough to hold the common information of the children. Since the children were substantially different, we created separate tables for them. So I have something like this: tblMaster -------- MasterID int Name varchar(50) --Common to all children and there are a bunch of fields like this ChildType int -- Type of Child either ChildOne or ChildTwo ChildID int -- need to store ChildOneID or ChildTwoID depending on type of Child, so that i can refer to children tblChild1 -------- ChildOneID int IDENTITY tblChild2 --------- ChildTwoID int IDENTITY Should I have a ChildID in the master that is either ChildOneID or ChildTwoID based on the ChildType column? I have a number of children and I have simplified it for this question. The other way is to add ChildOneID and ChildTwoID as columns in the master, but since i have a number of columns, I will have a lot of null columns EDIT: Any help is appreciated

    Read the article

  • Filtering coluns in SQL Server replication - how?

    - by truthseeker
    Hi, I need to replicate some data from two tables in one database to another databases. I used snapshot replication. The issue is that I would like to replicate only some selected columns and the others should stay with untouched data. I don't want to loose their data. The sours of those columns is other system. So I need to replicate only data from my columns. Do anybody know how to achieve this?

    Read the article

  • How do you map a composite id to a composite user type with Fluent NHibernate?

    - by gabe
    i'm working w/ a legacy database is set-up stupidly with an index composed of a char id column and two char columns which make up a date and time, respectively. I have created a icompositeusertype for the date and time columns to map to a single .NET DateTime property on my entity, which works by itself when not part of the id. i need to somehow use a composite id with key property mapping that includes my icompositeusertype for mapping to the two char date and time columns. Apparently w/ my version of Fluent NHibernate, CompositeIdentityPart doesn't have a CustomTypeIs() method, so i can't just do the following in my override: mapping.UseCompositeId() .WithKeyProperty(x => x.Id, CommonDatabaseFieldNames.Id) .WithKeyProperty(x => x.FileCreationDateTime) .CustomTypeIs<FileCreationDateTimeType>(); is something like this even possible w/ NHibernate let alone Fluent? I haven't been able to find anything on this.

    Read the article

  • Handling changes in column order when importing CSV files

    - by Scott
    I have a CSV file. The first row will always contain column headers. Depending on a variety of factors, the order of columns may change and, in rare circumstances, some columns may not be present. These changes are beyond my control. My thoughts, so far, on how to address this. I'll read the first row of the file and use the values to generate a list of columns contained in the source file. The destination file will use the same column names as the source. This should be as simple as searching for identical names in the source and destination, then just mapping the column index values, right? What are your recommendations for handling this?

    Read the article

  • C#:multicolumn sorting of datagrid view

    - by Bi
    I have a datagridview in a windows form with 3 columns: Serial number, Name and Date-Time. The Name column will always have either of the two values: "name1" or "name2". I need to sort these columns such that the grid displays all the rows with name values in a specific order (first display all the "name1" rows and then all the "name2" rows). Within the "name1" rows, I want the rows to be sorted by the Date-Time. Please note programmatically, all the 3 columns are strings. For example, if I have the rows: 01 |Name1 | 2010-05-05 10:00 PM 02 |Name2 | 2010-05-02 08:00 AM 03 |Name2 | 2010-05-01 08:00 AM 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM needs to be sorted as 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM 01 |Name1 | 2010-05-05 10:00 PM 03 |Name2 | 2010-05-01 08:00 AM 02 |Name2 | 2010-05-02 08:00 AM I am not sure how to go about using the below: myGrid.Sort(.....,ListSortDirection.Ascending)

    Read the article

  • SSIS: Update a RecordSet passed into a VB.NET ScriptTask

    - by Zambouras
    What I am trying to accomplish is using this script task to continually insert into a generated RecordSet I know how to access it in the script however I do not know how to update it after my changes to the DataTable have been made. Code is Below: Dim EmailsToSend As New OleDb.OleDbDataAdapter Dim EmailsToSendDt As New DataTable("EmailsToSend") Dim CurrentEmailsToSend As New DataTable Dim EmailsToSendRow As DataRow EmailsToSendDt.Columns.Add("SiteMgrUserId", System.Type.GetType("System.Integer")) EmailsToSendDt.Columns.Add("EmailAddress", System.Type.GetType("System.String")) EmailsToSendDt.Columns.Add("EmailMessage", System.Type.GetType("System.String")) EmailsToSendRow = EmailsToSendDt.NewRow() EmailsToSendRow.Item("SiteMgrUserId") = siteMgrUserId EmailsToSendRow.Item("EmailAddress") = siteMgrEmail EmailsToSendRow.Item("EmailMessage") = EmailMessage.ToString EmailsToSend.Fill(CurrentEmailsToSend, Dts.Variables("EmailsToSend").Value) EmailsToSendDt.Merge(CurrentEmailsToSend, True) Basically my goal is to create a single row in a new data table. Get the current record set, merge the results so I have my result DataTable. Now I just need to update the ReadWriteVariable for my script. Do not know if I have to do anything special or if I can just assign it directly to the DataTable I.E. Dts.Variables("EmailsToSend").Value = EmailsToSendDt Thanks for the help in advanced.

    Read the article

  • Is both approach same ?

    - by Harikrishna
    I have one datatable which is not bindided and records are coming from the file by parsing it in the datatable dynamically every time. Now there is three columns in the datatable Marks1,Marks2 and FinalMarks. And their types is decimal. Now for making addition of columns Marks1 and Marks2 's records and store it into FinalMarks column,For that what I do is : datatableResult.Columns["FinalMarks"].Expression="Marks1+Marks2"; It's works properly. It can be done in other way also is foreach (DataRow r in datatableResult.Rows) { r["FinalMarks"]=Convert.ToDecimal(r["Marks1"])+Convert.ToDecimal(r["Marks2"]); } Now I don't know that which is the best way to do this means performance wise. Is first approach same as second approach in background means is both approach same or what?

    Read the article

  • optimized grid for rectangular items

    - by peterchen
    I have N rectangular items with an aspect ratio Aitem (X:Y). I have a rectangular display area with an aspect ratio Aview The items should be arranged in a table-like layout (i.e. r rows, c columns). what is the ideal grid rows x columns, so that individual items are largest? (rows * colums = N, of course - i.e. there may be "unused" grid places). A simple algorithm could iterate over rows = 1..N, calculate the required number of columns, and keep the row/column pair with the largest items. I wonder if there's a non-iterative algorithm, though (e.g. for Aitem = Aview = 1, rows / cols can be approximated by sqrt(N)).

    Read the article

  • Problem with table resizing after automatically removing from jquery one column (this only happens i

    - by user297433
    Hi. I have a table with some columns. Something like this: tr1td1 one remove button tr1td2 one remove button ... The table has the size of the div#outer When I click remove button I remove with jquery the entire column . In Firefox everything's fine the table's columns resize to fill the div but in Internet Explorer the table's columns remain just as they are. It's like the browser doesn't refresh the css style. Because if I refresh the page the table looks just as it shoud be. Any ideas?

    Read the article

  • How to update many databases when we update any tablw

    - by Lalit Kandpal
    I am creating a C# window application which is based on a medical inventory.In this application I have mainly three forms as PurchaseDetail,SalesDetail,and StockDetail. Now I want a functionality in which if i insert or modify the records in PurchaseDetail,or SalesDetail the Data in the StockDetail should also be modified.(for example if i insert some quantity of medicines in PurchaseDetail then Quantity In StockDetail should also modified and same as for SalesDetail ) Columns in PurchaseDetail: Id(Primary Key and auto increment int),BatchNumber,MedicineName,ManufacturingDate,ExpiryDate,Rate,MRP,Tax,Discount,Quantity Columns in SalesDetail: Id(PrimaryKey and auto increment int),BillNumber,CustomerName,BatchNumber,Quantity,Rate,SalesDate Columns in StockDetail: Id(Primary Key and auto increment int),ProductId,ProductName,OpeningStock,ClosingStock,PurchaseQty,DispenseQty,PurchaseReturn,DispenseReturn Please Help me.

    Read the article

  • Data frame linear fit in R

    - by user1247384
    This is perhaps a simple question, but I am n00b.Say I have a data frame with a bunch of columns. I need to call lm function over the column 1 and 2, 1 and 3, and so on. So basically I need to loop over all columns and store the results of the fit as I build the model. The problem I am running into is that lm(df[1]~df[2], data = df) doesnt work. In this case df is the data frame object and df[1] is the first column. What is a good way to do this in a loop, as in access the columns of df in an iterative fashion. Thanks.

    Read the article

  • C#: multicolumn sorting of DataGridView

    - by Bi
    I have a DataGridView in a windows form with 3 columns: Serial number, Name, and Date-Time. The Name column will always have either of the two values: "name1" or "name2". I need to sort these columns such that the grid displays all the rows with name values in a specific order (first display all the "name1" rows and then all the "name2" rows). Within the "name1" rows, I want the rows to be sorted by the Date-Time. Please note programmatically, all the 3 columns are strings. For example, if I have the rows: 01 |Name1 | 2010-05-05 10:00 PM 02 |Name2 | 2010-05-02 08:00 AM 03 |Name2 | 2010-05-01 08:00 AM 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM needs to be sorted as 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM 01 |Name1 | 2010-05-05 10:00 PM 03 |Name2 | 2010-05-01 08:00 AM 02 |Name2 | 2010-05-02 08:00 AM I am not sure how to go about using the below: myGrid.Sort(.....,ListSortDirection.Ascending)

    Read the article

  • Entity Framework projections

    - by David McClelland
    We are investigating the Entity Framework to see if it will meet our particular needs. Here is the scenario I am interested in: I have a large table (let's call it VeryWideRecord) which has many columns, and it has a corresponding business object (it's also called VeryWideRecord). I would like to be able to query my database for a VeryWideRecord business object, but only have values for certain columns returned by the underlying SQL. Can I do this with the Entity Framework? I am uncertain as to whether this could be done with the Entity Framework's table splitting feature, because the application needs to be able (at runtime) to change the columns that are requested. The reason for this is that we are trying to minimize the amount of information that is going across the wire. I see how this could be done using NHibernate (example), but how can I do this with the Entity Framework?

    Read the article

  • Doctrine 1.2 Column Naming Conventions for Many To Many Relationships

    - by Alan Storm
    I'm working with an existing database schema, and trying to setup two Doctrine models with a Many to Many relationship, as described in this document When creating tables from scratch, I have no trouble getting this working. However, the existing join tables use a different naming convention that what's described in the Doctrine document. Specifically Table 1 -------------------------------------------------- table_1_id ....other columns.... Table 2 -------------------------------------------------- table_2_id ....other columns.... Join Table -------------------------------------------------- fktable1_id fktable_2_id Basically, the previous developers prefaced all forign keys with an fk. From the examples I've seen and some brief experimenting with code, it appears that Doctrine 1.2 requires that the join table use the same column names as the tables it's joining in Is my assumption correct? If so, has the situation changed in Doctrine 2? If the answers to either of the above are true, how do you configure the models so that all the columns "line up"

    Read the article

  • SSRS 2005 concat values in dropdown parameter

    - by Mac
    Hi All, I have a dataset which I want to use as a parameter for my chart in SSRS. The puzzle that I am trying to solve is as below. My DataSet has 4 columns and in the Dropdown parameter I can only specify label and value. I am not able to specify two columns as Label and two columns as value. Does anyone know how to concat the values in the dropdown? I don't want to concat these values in my sql query generating the dataset.

    Read the article

  • Is there a better way to do SELECT queries in MySQL and sort them in PHP than this way?

    - by Kent
    I am just learning PHP/MySQL, one this I am having to do a lot is displaying data that was previously inserted into the database out to the user's browser. So I am doing this: $select = mysql_query('SELECT * FROM pages'); while ($return = mysql_fetch_assoc($select)) { $title = $return['title']; $author = $return['author']; $content = $return['content']; } then I can use these variables through out the page. Now, doing it the above way isn't an issue when I only have 3 columns in a database but what if I am dealing with a huge database with many more columns. I have a nagging feeling that the pros do it in some more efficient way where they maybe loop through the table they are selecting from to find all columns it has and associate them with variables automatically. Is that the case? or is the above how you guys do it too?

    Read the article

  • improve my python program to fetch the desire rows by using if condition

    - by user2560507
    unique.txt file contains: 2 columns with columns separated by tab. total.txt file contains: 3 columns each column separated by tab. I take each row from unique.txt file and find that in total.txt file. If present then extract entire row from total.txt and save it in new output file. ###Total.txt column a column b column c interaction1 mitochondria_205000_225000 mitochondria_195000_215000 interaction2 mitochondria_345000_365000 mitochondria_335000_355000 interaction3 mitochondria_345000_365000 mitochondria_5000_25000 interaction4 chloroplast_115000_128207 chloroplast_35000_55000 interaction5 chloroplast_115000_128207 chloroplast_15000_35000 interaction15 2_10515000_10535000 2_10505000_10525000 ###Unique.txt column a column b mitochondria_205000_225000 mitochondria_195000_215000 mitochondria_345000_365000 mitochondria_335000_355000 mitochondria_345000_365000 mitochondria_5000_25000 chloroplast_115000_128207 chloroplast_35000_55000 chloroplast_115000_128207 chloroplast_15000_35000 mitochondria_185000_205000 mitochondria_25000_45000 2_16595000_16615000 2_16585000_16605000 4_2785000_2805000 4_2775000_2795000 4_11395000_11415000 4_11385000_11405000 4_2875000_2895000 4_2865000_2885000 4_13745000_13765000 4_13735000_13755000 My program: file=open('total.txt') file2 = open('unique.txt') all_content=file.readlines() all_content2=file2.readlines() store_id_lines = [] ff = open('match.dat', 'w') for i in range(len(all_content)): line=all_content[i].split('\t') seq=line[1]+'\t'+line[2] for j in range(len(all_content2)): if all_content2[j]==seq: ff.write(seq) break Problem: but istide of giving desire output (values of those 1st column that fulfile the if condition). i nead somthing like if jth of unique.txt == ith of total.txt then write ith row of total.txt into new file.

    Read the article

  • mysql inserts & updates optimized

    - by user271619
    This is an optimization question, mostly. I have many forms on my sites that do simple Inserts and Updates. (Nothing complicated) But, several of the form's input fields are not necessary and may be left empty. (again, nothing complicated) However, my SQL query will have all columns in the Statement. My question, is it best to optimize the Inserts/Update queries appropriately? And only apply the columns that are changed into the query? We all hear that we shouldn't use the "SELECT *" query, unless it's absolutely needed for displaying all columns. But what about Inserts & Updates? Hope this makes sense. I'm sure any amount of optimization is acceptable. But I never really hear about this, specifically, from anyone.

    Read the article

  • How to achieve "merge" of two data sets with Insert SQL statemen (Oracle DBMS)t?

    - by Roman Kagan
    Hi: What would be the insert SQL statement to merge data from two tables. For example I have events_source_1 table (columns: event_type_id, event_date) and events_source_2 table (same columns) and events_target table (columns: event_type_id, past_event_date nullalbe, future_event_date nullable). Events_source_1 has past events, Events_source_2 has future events and resultant events_target would contain past and future events in the same row for same event_type_id. If there is no past_events but future_events then past_event_date won't be set and only future_event_date will be and the opposite is true too. Thanks a lot in advance for helping me resolving this problem.

    Read the article

  • Data Grid Shows extra column

    - by cre-johnny07
    I have a wpf data Grid where I created twlo columns. But whenever I run the window the datagrid shows a extra column. I can't figure out why.? Below is my code <Custom:DataGrid Background="White" AlternatingRowBackground="#103D7EC5" RowHeaderWidth="20" SelectionMode="Single" SelectionUnit="FullRow" GridLinesVisibility="None" MinRowHeight="30" EnableRowVirtualization="True" EnableColumnVirtualization="True" CanUserAddRows="False" CanUserSortColumns="True" AreRowDetailsFrozen="True" RowDetailsVisibilityMode="Collapsed" ItemsSource="{Binding CurrentEntity.RefDetails, Mode = TwoWay}" AutoGenerateColumns="False" Name="grdDoctor1" ScrollViewer.VerticalScrollBarVisibility="Auto" MaxHeight="200"> <Custom:DataGrid.RowDetailsTemplate> <DataTemplate> </DataTemplate> </Custom:DataGrid.RowDetailsTemplate> <Custom:DataGrid.Columns> <Custom:DataGridTextColumn Binding="{Binding DepId}" Width="100" IsReadOnly="True" Header="Id"/> <Custom:DataGridTextColumn Binding="{Binding DepData}" Width="100" IsReadOnly="False" Header="Data"/> </Custom:DataGrid.Columns> </Custom:DataGrid> Any suggestion why this is happening..?

    Read the article

  • Improving MySQL Update Query Efficiency

    - by Russell C.
    In our database tables we keep a number of counting columns to help reduce the number of simple lookup queries. For example, in our users table we have columns for the number of reviews written, photos uploaded, friends, followers, etc. To help make sure these stay in sync we have a script that runs periodically to check and update these counting columns. The problem is that now that our database has grown significantly the queries we have been using are taking forever to run since they are totally inefficient. I would appreciate someone with more MySQL knowledge than myself to recommend how we can improve it's efficiency: update users set photos=(select count(*) from photos where photos.status="A" AND photos.user_id=users.id) where users.status="A"; If this were a select statement I would just use a join but I'm not sure if that is possible with update. Thanks in advance for your help!

    Read the article

  • display format for gridview

    - by peter
    I have a grid named 'GridView1' contains two columns 'Date' and 'Session Deatils' i am displaying like this way only <asp:GridView ID="GridView1" OnRowCommand="ScheduleGridView_RowCommand" runat="server" AutoGenerateColumns="False" Height="60px" Style="text-align: center" Width="869px" EnableViewState="False"> <Columns> <asp:BoundField HeaderText="Date" DataField="Date"><HeaderStyle Width="80px" /></asp:BoundField> <asp:BoundField DataField="" HeaderText="Session Detais" /> </Columns> But here i need to display 3 column sections downside Session details without any column borders for each dates,,how can i achive like this wasy Date SessionDetails 06-04-2010 Time-(value from database) Topic-(value from database) Head-(value from database) ------- ------------------ ------------------- ----------------------

    Read the article

  • How to select the range for pasting using vba

    - by user1616384
    I wrote some code for selecting the particular row and pasting it in column wise using paste-special property. It is working correctly my code is : lngRow = Me.TextBox4.Value strCol = Me.TextBox5.Value Set rng = Range("A:A").Find(What:=lngRow, LookIn:=xlValues, LookAt:=xlWhole) If rng Is Nothing Then MsgBox "Value not found in row 1", vbExclamation Else Range(rng, rng.End(xlToRight)).Copy Range("A1:E3").Columns(strCol).Offset(, 1).PasteSpecial Transpose:=True Range("A1:E3").Rows(1).Copy Range("A1:E3").Columns(strCol).PasteSpecial Transpose:=True endif the problem here is I am using Range(rng, rng.End(xlToRight)).Copy to copy the values and for pasting I am using Range("A1:E3").Columns(strCol).Offset(, 1).PasteSpecial Transpose:=True. How can I paste all the values which are copied? Because if the values are in column F then this macro will not paste those values.

    Read the article

  • insert DropDownList and TextField in Gridview

    - by userk
    HI,I need to create a GridView which DataSource is an object. Depending on the object I may need some columns with DropDownLists or TextFields (but not all rows) As I don't know the number or columns, they have to be dynamic. I found this solution: TemplateField t = new TemplateField(); t.HeaderTemplate = new GridViewTemplate("header", "title"); t.ItemTemplate = new GridViewTemplate("combobox", "val"); GridView1.Columns.Add(t); GridView1.DataSource = ds; GridView1.DataBind(); Where GridViewTemplate extends ITemplate. This didn't work for me, it fills all rows of a column and I had no way to control witch DropDownList and TextFields need to be created (object info). All the DropDownLists need to have an ID also only known by the object. There are some way I can do this?

    Read the article

  • Reusing an anonymous parameter in a prepared statement

    - by Chris Lieb
    I am customizing the insert SQL generated by hibernate and have hit an issue. When Hibernate generates the query by itself, it inserts data into the first two columns of the table, but this causes a database error since all four columns of the table are non-nullable. For the insert to be performed properly, it must insert the same data into two columns of the new record. This means that I need Hibernate to bind the same data to two different parameters in the query (prepared statement) that I am writing. Is there some SQL syntax that allows me to refer to anonymous parameters bound to a prepared statement in an order different from which they are bound? Details REF_USER_PAGE_XREF ---------------------------------------- PK FK1 | NETWORK_ID | VARCHAR2(100) PK FK1 | PAGE_PATH | VARCHAR2(1000) | USER_LAST_UPDT | VARCHAR2(100) | TMSP_LAST_UPDT | DATE insert into REF_USER_ROLE_XREF( NETWORK_ID, PAGE_PATH, TMSP_LAST_UPDT, USER_LAST_UPDT) values ( ?, /* want to insert the same data here */ ?, ?, /* and here */ (select to_char(sysdate, 'DD-MON-YY') from dual) I want to insert the same data into the first and third anonymous parameters.

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >