C# :: How To Add A Child Row To A Table

Aug 1, 2014

I have a table in which data is populated via an element. However some elements can have a parent element

The client now wants all the children and parent elements to be next to each other row wise.

How can i add the child rows under the parent rows?

parents
foreach (var inspection in elemInspections) {
var date = db.INSPEVNT.Find(db.INSPEVNT.INSPKEY == inspection.INSPKEY && db.INSPEVNT.BRKEY == m_sBrKey);
var paircode = db.PON_ELEM_DEFS.Find(db.PON_ELEM_DEFS.ELEM_KEY == inspection.ELEM_KEY);

[Code] .....

how can i make it so the children go under the parent rows?

View 2 Replies


ADVERTISEMENT

C++ :: Hash Table Program - Sorting Pointer Table After All Of Values Entered

Nov 19, 2013

I am having an issue with my sort function. This is one part of the Hash table program. The main issue is that I am trying to sort the pointer table after all of the values have been entered. The ptr_sort function is not a class function and so I am therefore unable to use the class variables psize and pTable. Is there another way I should be trying this? it is a Vector should I use the sort() function from the vector class in STL?

#include "/home/onyuksel/courses/340/progs/13f/p9/util9.h"
#include "/home/onyuksel/courses/340/progs/13f/p9/hTable.h"

#ifndef H_TABLE1
#define H_TABLE1
void ptr_sort ( );

[Code] ....

View 1 Replies View Related

C++ :: Truth Table Generator - If User Enters String Of Boolean Algebra It Will Output Table

Jan 25, 2013

If a user enters a string of boolean algebra it will ouput the table.

I have input parsing, cycling through the combinations, and outputing working. However once i parse the input I am not sure what to do with it. I have thought of having it write the parsed input to a new file as a function and then use that function, but that seems bad.

How to dynamically create the function, how to implement it.

BTW This is a console function, if that changes anything.

View 2 Replies View Related

C# :: Lookup Non-existent Rows In MySQL Table And Then Update Another Table

Dec 15, 2014

I have written an SQL statement that would:

1) Count the number of rows in the table booking that are open and where the booking.postcode is "MK",

2) Take a note of the plot (in booking.plot_id), and then update the table plot.jobs with the value count.

For example running the SQL query when booking table has the following rows:

Would see the following highlighted values in plot.jobs being updated to 1:

I managed to resolve it with this code so far (note I am using Connector/Net):

public void RefreshPlot(){
string query =
"SELECT Count(*) AS count, plot_id FROM booking WHERE postcode='MK' AND status='open' GROUP BY plot_id";
var cmd = new MySqlCommand(query, _connection);
var da = new MySqlDataAdapter(cmd);
var dtCounts = new DataTable();
da.Fill(dtCounts);

[code]....

Currently, my code only checks for existing rows in the booking table and updates the plot table. However if the row gets deleted in the booking, then the changes are not reflected in the plot table.

Example: If we delete the row with plot.id=1 and plot.plot_id=4, then booking.plot_id should go back to being 0, if it was initially 1. At the moment, it doesn't. How would I update my SQL statement to better reflect this? In a sense, it should check for "non-existent" rows, i.e. the impact that the row plot.plot_id=4 & plot.id=1 has on booking.plot_id when deleted?

View 6 Replies View Related

C Sharp :: Copy Data Table To MySQL Table

Mar 25, 2013

I have a C# .NET Application which get data from QuickBooks via the ODBC Driver and save the result to C# data table. So, I want to transfer this data table to a mysql table on my own server. That's the code I use:
 
using System.IO;
using MySql.Data.MySqlClient;
//Add mysql dll on the .NET Tab in Project's references  
string connStr = "DSN=QBTest;";  
            string myServerAddress = "192.168.0.243";
            string myDataBase = "CostTest";

[Code] ....

View 2 Replies View Related

C# :: Use Table Adapter With Textboxes To Edit SQL Table?

Mar 8, 2015

I am a bit stumped with trying to write some code to get the tableadapter/binding source to "update" a current 'user' to the table.

I have the insert/delete methods working fine, but it's the updating that has got me screwed up.

Example of insert.

try
{
personTableAdapter.Insert(tFirstName.Text, tSurname.Text, Convert.ToDateTime(tDoB.Text), tPhone.Text, tAdd1.Text, tAdd2.Text, tSuburb.Text, tState.Text, tPostcode.Text, TeacherType.Text);
teacherTableAdapter.Insert(Convert.ToInt32(tTID1.Text), tRegNo.Text, tPassword.Text);

[Code]....

I also tried to do the updated string/original string with the tableadapter.update, but that didn't work either.

View 7 Replies View Related

C :: Pipes Between Child Processes

May 5, 2014

I wrote a C program that is supposed to create a certain number of child processes, each child process having to change 1 letter from a string. The string and the number of child processes are read from the keyboard. I want to do it using pipes.

It should work like this: The parent changes one letter, then the first child takes the string modified by the parent and changes one more letter. The second child takes the string modified by the first one (2 letters are already changed) and changes one more and so on. I am new to C and am not quite sure how it all works, especially pipes. Also can the children be linked between them through the pipe, or can they only be linked to the parent and it has to be something like: first child changes a letter, gives the string back to the parent and then the second child reads from there, modifies letter and gives back.

If it's like that, is there any way to make sure that this doesn't happen: Apples becomes AppleD and then AppleX and then AppleQ? For example:

Code:
Input: Apples
Output: Applex Appldx Aqpldx My problem is: I don't get any output from the children.

Here's my code:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sys/types.h>
#include<unistd.h>
#include <sys/wait.h>

[Code] .....

View 2 Replies View Related

C++ :: Executing A Child Process?

Oct 11, 2012

how I can run this as a separate process from the parent program, like a child process,

and return the result back to the parent program.

this script is as follows.

if file "/Stuff/s" exists then continue to run, if file "/Stuff/t" exists, then print "started" if file "/Stuff/t" does not exists, then print "stopped"

if file "/Stuff/s" does not exist then print "quit" and then quit.

Code:
void controlxmmscheck( ) {
if( access( "/Stuff/s", F_OK ) != -1 ) {
xmmscheck
} else {

[Code]....

View 1 Replies View Related

C++ :: Size Of Object Of Class Child?

Feb 5, 2014

hiclass Parent {
};
class Child : virtual public Parent {
};

What is the size of object of Class Child in following case?

View 17 Replies View Related

C# :: How To Allow TreeView To Have Child Nodes Of Different UI Types

Jul 14, 2014

Right now I'm working on a TreeView for which I would like to add a TextBlock and a ComboBox as child nodes of a Parent TextBlock node. This would look something like this:

My TreeView is implemented using an MVVM style, and utilizes a HierarchicalDataTemplate. I have had no problems with adding TextBlock nodes and TextBlock children, but the confusion seems to arise when adding child nodes of different UI types.

I have tried implementing a stackPanel, like so:

<HierarchicalDataTemplate DataType="{x:Type Data:Node}" ItemsSource="{Binding Teams}">
<StackPanel>
<TextBlock Text="{Binding IndividualProperty}" />
<ComboBox ItemsSource="{Binding CollectionProperty}" />
</StackPanel>
</HierarchicalDataTemplate>

But then I end up with each node looking like this. It's like each node comes with one TextBlock and a ComboBox (Note: The comboBox is not the child, it and the TextBlock are one node):

How do I allow my treeView to have child nodes of different UI types? I am thinking that my solution has to do with my Hierarchical Data Template.

View 4 Replies View Related

C/C++ :: How To Create Single Instance Of Child Exe

Nov 13, 2013

I have an MFC application(.exe) in which i am creating an pointer object to CComQIptr<chemst::IChems>myinfo and after this i have using cocreate instance i had created the object launching that object, so Where i am using that CComQIptr object.

I have been creating instance to that COM exe (child exe) and at the end of the function i am releasing that object (myinfo->release).i want to create single instance for it and i want to use them in different .cpp files and finally i want to kill the child exe. Even though i release the object it is still alive.(Visualising in Task manager whether the exe is still alive or not).

View 1 Replies View Related

C++ :: Give Output To Child Process

Apr 15, 2012

I'm trying to build a basic shell for Unix. This is the code I use to create a new process:

Code:
pid = fork();
if (pid == 0) {
setpgrp();
complexCommand(argv, isComplex);

[code] .....

Where complexCommand is a function that handles the command (uses execvp after generating the correct string out of argv). My problem is that after if while in the shell I use a program that needs to print to the screen and handle input, it doesn't work as expected. To test this, I built this small program:

Code:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main() {
int x1, x2;

[code] ....

And when I use the shell I built to run it, the output is only "Enter 2 numbers" for one time. It doesn't print the result, or anything else. Is there anything I need to do in the parent process (my shell in this case) to give the child the output?

View 2 Replies View Related

C++ :: Deleting Node (With Two Child) In Trees

Sep 20, 2013

I have Problems with deleting node in trees!my first problem is I don't understand the algorithm of deleting a node with two child! I write some kind of code that delete a node with two child but I think (maybe I should say I am sure ) that it has runtime or logical errors or something like that!

My second problem is my code doesn't work if my node is root of tree!because I don't know if it is root what should be the parentPtr in my code! I set parentPtr to NULL in this situation but I know it is wrong!

Here is my Code :

#include <iostream>
#include "TreeNode.h"
using namespace std;
template<typename NODETYPE> class Tree {
public:
Tree();
void insertNode(const NODETYPE &);

[Code] .....

View 3 Replies View Related

C++ :: Function Overloading In Child Class?

Jan 17, 2014

I am facing some problems while overloading base class functoin in child class. I have 2 programs as listed below.

Program 1 :

#include <iostream>
using namespace std;
class base
{

[Code].....

Compilation Errors:

child_overload.cpp: In function "int main()":
child_overload.cpp:27: error: no matching function for call to "child::func(const char [16])"
child_overload.cpp:17: note: candidates are: void child::func(double)

I thought as base class members are also as part of child class through "public" access specifier, it should access base class function, when funct() is called with a string. if I use "using base::func" in child, it works fine. But why I need that when base class memebers are part of child class?

View 2 Replies View Related

Visual C++ :: How To Create MDI Child With Borders

Jan 7, 2013

How can I create MS Word 'print layout' like interface. The attached picture says it all. Basically I want a shaded area around my document just like word so it gives a feel of the 'page'.

I was hoping I can override some function somewhere and along that lines tried playing around with below but that didn't work.

Code:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) {
if( !CFrameWndEx::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.cx = 250; // just playing around with size
cs.cy = 250;
return TRUE;
}

How can I do that?

View 6 Replies View Related

Visual C++ :: Child Window On Top Of Control

Nov 30, 2014

I have a child window above an edit control.

When the position of the control in the parent in the child on top of it is clicked the control gets topmost. Is there any way to prevent this?

View 3 Replies View Related

Visual C++ :: MFC Child Windows Application

Nov 9, 2013

I am new in Visual C++ and I have to make an MFC application with "child" windows. Here is what i need to achieve - [URL] ..... As you can observe when you click on the cross of popup window or child window 2 both are closing.

View 2 Replies View Related

C :: Code That Will Store PID Numbers Of Child After A Fork?

Aug 8, 2013

I am currently trying to write a code that will store PID numbers of a child after a fork, I have to be able to enter an amount that will be created, so far I have managed to be able to get them to print (which puts me on the right path as far as I am concerned) but I am having issues. Using the following code:

Code:

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

[Code].....

View 3 Replies View Related

C++ :: Reflect Child Classes From Base Class

Nov 26, 2013

We want a solution in C++ that must be able to do the following:

Given a string of particular type, lets say 'A', we want to find all the types that derives from 'A'.

Instantiate new objects out of the types that are derived from 'A'.

E.g. Lets say we have a class, VehicleEntity. VehicleEntityhas child classes, PassangerCarEntity, TruckEntity, TrainEntity, BoatEntity.

We are unsure what vehicle entities there may be as the a library could be added containing more VehicleEntities. E.g. an AirplaneEntity thaterives from VehicleEntity could be added after deployment.

In the application, when a user wants to select a VehicleEntity, the user should be able to pick any of the entities deriving from VehicleEntity. This includes the PassangerCarEntity, TruckEntity, TrainEntity, BoatEntity and AirplaneEntity. The user selects an Entity, lets say AirplaneEntity, A new object of type AirplaneEntity must be instantiated.

The following is an concept example in C# of what we want to achieve in C++.

In C# the items for the dropdown list can be retrieved as follows:

Type vehicleEntityType = typeof(VehicleEntity);
List<Type> types = new List<Type>();
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())

[Code] .....

We are aware that standard C++ does not contain any Metadata on its objects, and thus it is not possible without a workaround. It does not seem possible with RTTI and boost.Mirror.

View 7 Replies View Related

C++ :: Writing To 2D Array Of Pipes In Child Process

Apr 15, 2014

I am writing a program that is supposed to open a directory as a command line argument, read that directory, open each file and count a number of occurrences of a certain character, taken from the user as cin, fork the parent process to create a child process for each file. a pipe is created for communication with the parent and a 2 dimensional array of pipes is needed for communication with each child process (each file), one for the pipe number and the other is the read/write descriptor(0 or 1). My program is looping through all the files ok, but it seems it isn't writing the "char a" to the pipe correctly. f

For every child, do_child_stuff() is called, and it reads the file name, opens it, counts the # of occurrences and returns that count to the parent to hold a total for all the files. normally to write to a pipe, it should be write(pipe_name[1], &a, sizeof(a)) but I don't know how to do this with an array of pipes. i try to write to it by doing write(child_pipe[pc][1], &a...) pc is the array position for that pipe and it gets incremented after reading each file.

struct dirent *d;
struct stat sb;
int adult_pipe[2];
int child_pipes[1000][2];

[Code]....

View 5 Replies View Related

C++ :: Copying Purely Virtual Class Child

Oct 27, 2014

In short, this is what I have

class A{
A(){}
virtual void pure() = 0;
}

[Code] .....

I need a2 to be a deep copy of a1, but if I understand it correctly, then a2 should just be a pointer copy of a1. How do I make a2 be a different instance of B?

View 5 Replies View Related

C/C++ :: Two Way Communication Between Child And Parent Processes (pipes)

Mar 19, 2014

I want parent and child processes to communicate in C linux using pipes. I have created two file descriptors. one for parent to child i.e. readpipe and other writepipe for viceversa. But I am getting null as output for ch and ch1 strings in my code below.

#include <stdio.h>
#include<stdlib.h>
#include
#include<unistd.h>
int main(){
pid_t pid;

[Code] .....

View 1 Replies View Related

C# :: Editing A Parent Dialog Box Without Closing The Child

Sep 30, 2014

I'm using windows forms and I have a parent dialog box that consists of a text box and a drop-down that launches a child dialog box. The child takes user input and then prints dialog to the text box in the parent. However, the output does not appear in the text box until I close the child.

Now my question is, how do I get the text to appear without closing the child? I hit a button to send the info to the text box, but it still doesn't appear until the child closes. I also need to set up a button to suspend the child so that the user can click/copy/etc the parent.

View 7 Replies View Related

C Sharp :: How To Access Functions Between Two Child Forms

Oct 14, 2014

How can I access a function in a child form from another child form of a same owner?

View 1 Replies View Related

Visual C++ :: MFC MDI Tabbed Child Window Positioning

Jul 18, 2013

Is it possible to specify the size/position of tabs in an MFC MDI tabbed application?

I am trying to save the open tabs when exiting the program and restoring them when the application is relaunched. I have come up with a method of saving and reloading the tabs, but I cannot restore their position.

I have seen SaveMDIState and LoadMDIState but I can't make it do anything and I'm also not sure if it's what I need.

View 3 Replies View Related

Visual C++ :: Child Dialog Shadow Remains?

Oct 5, 2012

i open child dialog from a dialog( which is launched from a toolbar of a window) after editing i close the child dialog, after closing child dialog shadow is retained on window but not on the parent dialog. Later when i close the parent dialog the child dialog shadow disappears. (issue exist only when i edit in child dialog)

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved