C# :: Delete Method Not Working?
Apr 19, 2015
Here is the Method Code:
public void DeleteCustomer(string firstName, string lastName,
string address1, string address2, string city,
string state, string phoneNumber, int customerID)
{
[Code]....
.... And here is the response I get:
Error Deleting customer, please check form data. Syntax error in FROM clause.
View 13 Replies
ADVERTISEMENT
Oct 9, 2014
making my delete function work. My program does compile but my delete function doesn't work. I haven't finished my last two functions because I am focusing on the delete but how to Sell a title and print the value of all sold titles would be nice as well.
#include <iostream>
#include <cstdlib>
#include <string>
[Code].....
View 2 Replies
View Related
Oct 27, 2014
I am trying to write a method (copyStack())that copies the elements of one stack to another. So I am using a Type variable and a while loop, assigning the top of the first stack to the variable, and then using the push method to push the Type variable into my second stack (then poping the first stack). However, whenever it comes time to print the second stack (the one I am trying to copy into), nothing shows up. I know that the program is reaching the copyStack function, and I know that when I put a regular string in for the Type variable, it passes that string along. But for some reason, when I use the variable, nothing happens! Here's what I've got...
header file containing stack manipulators:
//Header File: linkedStack.h
#ifndef H_StackType
#define H_StackType
#include <iostream>
#include <cassert>
using namespace std;
[Code] ....
View 3 Replies
View Related
Jan 12, 2013
int main() {
int vnum = 0;
VEHICLE *vehiptr;
VEHICLE *dptr;
cout<<"Please enter the number of vehicle: ";
cin>>vnum;
vehiptr = new VEHICLE[vnum];
[Code] .....
View 9 Replies
View Related
Jan 17, 2013
I've been trying for more than one month to access a method found in a library called libcocosnas_static.a. I'm using Cocos2d-X version 2.0.4. The library has been used many times by my company to make games using cocos2d-1.0.1-x-0.12.0 without any problem.
This is what I've done:
1- I added the include paths of the library to both eclipse and Android.mk
2- Included the .h file using #include "NASPlatformUtil.h"
3- Added the libcocosnas_static.a file to the proj.androidobjlocalarmeabi folder
4- Added "LOCAL_WHOLE_STATIC_LIBRARIES += cocosnas_static" to the Android.mk file
5- Called the function using: NASPlatformUtil:: openUrl("http://xxx.xxx.com/");
I can right click on the function, click Open Declaration and get it without any problem, but the compiler keeps on giving me that dreaded error...
View 3 Replies
View Related
Dec 9, 2014
I have to manage a Clinic. I need to delete a booking (for example, if John said he's coming on March 22nd at 15:30 but then he say he's not going to come, I have to delete that booking so another person can use it).
idSearched: the id of the person that is not going to come. I have a lot of specialties and each one has a list. So I ask for the speciality to delete the node (the node contains John's booking). If I don't find it, I return (-1). searchSpecByID return a pointer to the list where the speciality is. So head will point to the first node of the list. In nodeToDelete I have the node I want to delete.
The program detects OK when is the first in the list and when not, but it doesn't delete the node.
Code:
typedef struct bookingList{
tSpecialty specialty;
struct nodo* intro;
} tList;
[Code].....
View 7 Replies
View Related
Feb 2, 2015
I have a question similar to the one here: [URL] .....
The main difference is I would like to pass a method of derived class as a parameter to some other method in its template base class.
template <typename BaseType>
class Base {
public:
typedef void (Base::*Callback)(int A);
[Code] .....
The above is an example which does not compile. My compiler complains that the two BaseMethod() calls in DerivedMethod() are invalid uses of non-static member function.
Is this not possible to do, or is my syntax simply wrong? All I want is to be able to pass as an an argument to a method in the base class from the derived class some callback as a variable for the base class to invoke later.
View 2 Replies
View Related
Nov 25, 2013
This problem relates to a program i am developing to ping all hosts on a network.
So far I've managed to access a PostgreSQL database to retrieve a CIDR network address e.g. 192.168.52.14/24.
I have then managed to mask the bits to get the network address.
So for e.g. above its 192.168.52.0
I now need some kind of algorithm to loop through available hosts so from.
192.168.52.0 - 192.168.52.255
I have got as far as deriving the network and separating it into an int array
So I have : ip_start[]= {192,168,52,0}
View 1 Replies
View Related
Mar 19, 2013
#include <iostream>
using namespace std;
struct A {
virtual void f() { cout<<"A
"; }
};
[code]...
I would expect that both examples 2 & 3 will give me the same result.I tried to figure it out but I could not. Both are references of a base class type, that get a derived object.
Q1 : why is the difference between them ?
As I see it, its kind of a mix between pointer - which in case of virtual method that was override in derived class - would give me the derived method (e.g. "B") and between regular object - which in case of virtual method that was override - would give me the specific method (Still "B"). So, example 2 "use" it as a regular object and example 3, "use" it as pointer.
Q2 : How should I refer to it ? I am using VS2008.
View 12 Replies
View Related
Feb 18, 2015
I have 2 classes with a Function with the same definition (both inherited from the same base class) and in my derived class I derive from both of those 2. Is it possible to use the Methods of both classes? for example with an other name?
class A {
protected:
int print(int a) { std::cout << "int A: " << a << std::endl; }
};
class B : A
[Code] ....
is there something like using C::print as printc;?
The Problem, I have a Sprite class that derives from a Rectangle with properties Position, Size, Origin and Angle and a Text class that derives from Rectangle. Now i have a Button class deriving from both Sprite and Text.
- The Position, when moving the Button i have to change the position of both so i Implemented a new Method which calls SetPosition from the Sprite and the Text.
- The SetSize just affects the Button so i just did using Sprite::SetSize;
- The angle affects both so i just implemented a new Method and hide the other two
The problem is here:
- The Origin: writing button.SetOrigin(-1,0) should set the Origin of the Button and writing button.SetTextOrigin should set the Origin of the text.
Should i just reimplement a Mehtod named SetTextOrigin and call Text::SetOrigin from there and hide the button.Text::SetOrigin or is there something like using Text::SetOrigin as SetTextOrigin?
View 6 Replies
View Related
Oct 11, 2013
It has been a few years since I have had to do this, but I need to declare a method in my base class, but produce no code for it. Then when this library is used by my second project I will derive a class from this base class and put the code into it there. How is this possible? I used to know how but do not remember how now.
The library is a static library designed for linking with both 32bit and 64bit Windows applications to handle a lot of the tedious stuff with Windows programming. The method in question handles specific command inputs. However, since each program that uses this library will have different uses for these commands, I want to leave it up to the user to code their own handling, but require it to be coded in the derived class.
View 2 Replies
View Related
Feb 28, 2015
I want to access the body of the Add() of a list in c# to see how it works, but it only just gives me the declaration.
[DebuggerTypeProxy(typeof (Mscorlib_CollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
[Serializable]
public class List<T> : IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable {
public void Add(T item); // thats all. I tried go to declaration but still gives me this line of code. This is from metadata in Visual studio.
}
How this thing work. It just a declaration not a definition yet its still doing something. How is that possible.
View 4 Replies
View Related
Sep 26, 2014
how to write a "charge simulation method" program in C or C++? It's to calculate electric distribution and also electric potential of two different dielectrics. I have attached the diagram of the shape of the electrode that needs to be investigated.
View 1 Replies
View Related
Dec 24, 2014
Allow users to enter their name and favorite saying in a single method that gets invoked two times. If I can only return one value at a time, how am I suppose to get name and favorite saying out of UserInput()?
static void Main(string[] args) {
string displayName, favoriteSaying;
DisplayInstructions();
Console.WriteLine();//readability
[Code] ....
View 3 Replies
View Related
Sep 29, 2014
I have to create a program that accepts 10 numbers from user, and then I display a list of the numbers, the smallest one and the higher number. I have problems with displaying the smallest and higher number, I tried to Array.Sort and Array.Reverse, but I don't know what I'm doing wrong, this is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SmallAndLargeGUI
[Code] ...
Also I tried to set
if (x == 10)
numberTextBox.Enabled = false;
to block the textbox when the user has entered 10 numbers, but didn't work either...
View 4 Replies
View Related
Feb 7, 2015
I am trying to input a recursion method. The code compiles, however, it is only giving me a value of 1. I am wanting the value of 5 when it is compiled. Why is this?
#include <iostream>
using namespace std;
int number(int x) {
if (x == 1)
[Code] ....
View 9 Replies
View Related
Feb 17, 2013
what is static method?
why we can use static method inc#?
View 1 Replies
View Related
Oct 17, 2012
I am studying the creation of classes in C + +. When executing the code below the method LEN class String2 not work.
code ----------------------------------------------------------------------------------------------
#include <iostream>
#include <string.h>
using namespace std;
[Code]......
View 4 Replies
View Related
May 6, 2014
OgreWidget.h
Code:
#ifndef __OGREWIDGET_H__
#define __OGREWIDGET_H__
#include <OGRE/Ogre.h>
#include <QGLWidget>
//#include <QX11Info>
class OgreWidget : public QGLWidget {
//Q_OBJECT;
[Code] ....
The inherited method called createScene is not called.
View 1 Replies
View Related
Dec 11, 2014
I need to call one function on my C++ program. I made one root calculator for functions, but, this doesn't work.
// FUNCION QUE CALCULA LA DIFERENCIA ENTRE 2 VECTORES
real mn_error_vectores(Array1D< real > &u, Array1D< real > &v) {
int i;
if(u.dim()!=v.dim()){
printf("mn_error_vectores() : arrays of different dimensions
[Code] ....
View 4 Replies
View Related
May 21, 2013
How to access a method from a .h file in another .cpp file
Code:
// main.cpp
#include <iostream>
#include "inc/one.h"
using namespace std;
int main( ){
School Tadd;
Tadd.AddTeacher(1);
return 0;
[Code] ....
When I compile , i am getting the below error
In function main:
undefined reference to `School::AddTeacher(int)'
Build finished: 1 error
View 4 Replies
View Related
Apr 29, 2014
I am new to c++ and trying to learn. for instance. i have a struct and method.I am trying to learn what i can do with the method if i define the return type as struct type.
struct S {
int age;
string name;
};
S method() {
//what i can do in here. with the Struct. I mean can i reach members of the struct. etc
}
View 2 Replies
View Related
May 27, 2013
I have 2 c++ libraries called "Lib1" and "Lib2". Both libraries have same class called "Total.h and Total.cpp"
I want to access lib1 class in lib2. since it has same class (i.e same header file), i couldn't refer lib1's members in lib2.
Lib 1 :
Total.h :
class Total {
public:
static void Test(double);
[Code] .....
How to access another library which has same name and how to add header file ?
View 1 Replies
View Related
May 11, 2013
I am working on a program to find the value of the current in a coil. This value satisfies the following equation:
y'=sin(2t)-[(ey-1)/(ey+1)]
which is of the form y'=f(t,y)
I know that in order to solve this I need to use the trapezoidal method to solve a differential equation, the formula is:
yn+1=yn+.5*h(f(tn,yn)+f(tn+1,yn+1) where h=tn+1-tn
I have found examples of the standard trapezoidal method but I do not think they will work because of the difference in the formulas.
View 2 Replies
View Related
May 30, 2013
I have one array with size of 5 and passing this array to one method. I want to get size of the array inside method. If i get size of array inside method, i'm getting only "1",but not "5".
int v[5];
v[0]=1;
v[1]=2;
v[2]=3;
v[3]=4;
v[4]=5;
cout<<sizeof(v)/sizeof(&v[0])<<endl; // here i'm getting size as 5
CreateArray(v);
void CreateArray(int val[])
{
cout<<sizeof(val)/sizeof(&val[0])<<endl; // here i'm getting size as 1
}
Is there any way to get size inside method ?
View 6 Replies
View Related
Sep 15, 2014
how do i send post with data to a php page on the net using c++? im using this for a file uploading site for my school group. and also, im planning to pass this as my project. but, i cant find a concrete way on how to send post method with data to a php page. ive been fed up with a lot of answers from the net, yet, each time i try to use them, i get errors. ive tried every library you can see till the third o of google. ive also tried a wrapper from this site, but, ive got no succes. im using dev c++.
View 5 Replies
View Related