473,796 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

smartclient: posting record through webservice (URGENT)

What is wrong with this

[WebMethod]
public bool syncTOmysqlcon( string Query)
{
try
{string strConnA = "Database=felcr adb;Data Source=developm ent;User
Id=root;Passwor d=citranet";

MySqlConnection myConnectionstr SQLA = new MySqlConnection (strConnA);
MySqlCommand myCommstrSQLA = new MySqlCommand(Qu ery);
myCommstrSQLA.C onnection = myConnectionstr SQLA;
myConnectionstr SQLA.Open();
int result = myCommstrSQLA.E xecuteNonQuery( );
myCommstrSQLA.C onnection.Close ();
return (result ==1);
}
catch(Exception ex)
{
return DataError(ex);
}

it always error when i call this webservice trough my windows apps.

felcraengine.fe lcracall.Servic e1 db = new felcraengine.fe lcracall.Servic e1();
bool tebabo = db.syncTOmysqlc on("INSERT INTO pst_settlers_co ntract_details
(ENTITY, APPLICANT_NO, AGREEMENT_NO, AGREEMENT_STATU S, AGREEMENT_SIGND ATE,
AGREEMENT_TYPE, APPLICANT_STATU S, DATE_EFFECTIVE, STATUS_DATE,
APPLICANT_REPLA CEMENT, OLD_IC_N0, NEW_IC_N0, CREATED_BY, CREATED_DATE,
UPDATED_BY, UPDATED_DATE, UPLOADED, UPLOADED_DATE) VALUES('', '', '', '',
'2005-10-9', '', '', '2005-10-9', '2005-10-9', '', '', '', '', '2005-10-9',
'', '2005-10-9', '', '2005-10-9')");

Thanks in advance!!

--
:: KHAMAL ::
Nov 23 '05 #1
5 1295
CG
you are returning an integar, whereas you should return "true" or "false"
bool.

"Khamal" wrote:
What is wrong with this

[WebMethod]
public bool syncTOmysqlcon( string Query)
{
try
{string strConnA = "Database=felcr adb;Data Source=developm ent;User
Id=root;Passwor d=citranet";

MySqlConnection myConnectionstr SQLA = new MySqlConnection (strConnA);
MySqlCommand myCommstrSQLA = new MySqlCommand(Qu ery);
myCommstrSQLA.C onnection = myConnectionstr SQLA;
myConnectionstr SQLA.Open();
int result = myCommstrSQLA.E xecuteNonQuery( );
myCommstrSQLA.C onnection.Close ();
return (result ==1);
}
catch(Exception ex)
{
return DataError(ex);
}

it always error when i call this webservice trough my windows apps.

felcraengine.fe lcracall.Servic e1 db = new felcraengine.fe lcracall.Servic e1();
bool tebabo = db.syncTOmysqlc on("INSERT INTO pst_settlers_co ntract_details
(ENTITY, APPLICANT_NO, AGREEMENT_NO, AGREEMENT_STATU S, AGREEMENT_SIGND ATE,
AGREEMENT_TYPE, APPLICANT_STATU S, DATE_EFFECTIVE, STATUS_DATE,
APPLICANT_REPLA CEMENT, OLD_IC_N0, NEW_IC_N0, CREATED_BY, CREATED_DATE,
UPDATED_BY, UPDATED_DATE, UPLOADED, UPLOADED_DATE) VALUES('', '', '', '',
'2005-10-9', '', '', '2005-10-9', '2005-10-9', '', '', '', '', '2005-10-9',
'', '2005-10-9', '', '2005-10-9')");

Thanks in advance!!

--
:: KHAMAL ::

Nov 23 '05 #2
hello CG..

what i've got from mysql help is this

You can use ExecuteNonQuery to perform any type of database operation,
however any resultsets returned will not be available. Any output parameters
used in calling a stored procedure will be populated with data and can be
retrieved after execution is complete. For UPDATE, INSERT, and DELETE
statements, the return value is the number of rows affected by the command.
For all other types of statements, the return value is -1.

when invoke actually i got it false....

it is not execute why????
--
:: KHAMAL ::
"CG" wrote:
you are returning an integar, whereas you should return "true" or "false"
bool.

"Khamal" wrote:
What is wrong with this

[WebMethod]
public bool syncTOmysqlcon( string Query)
{
try
{string strConnA = "Database=felcr adb;Data Source=developm ent;User
Id=root;Passwor d=citranet";

MySqlConnection myConnectionstr SQLA = new MySqlConnection (strConnA);
MySqlCommand myCommstrSQLA = new MySqlCommand(Qu ery);
myCommstrSQLA.C onnection = myConnectionstr SQLA;
myConnectionstr SQLA.Open();
int result = myCommstrSQLA.E xecuteNonQuery( );
myCommstrSQLA.C onnection.Close ();
return (result ==1);
}
catch(Exception ex)
{
return DataError(ex);
}

it always error when i call this webservice trough my windows apps.

felcraengine.fe lcracall.Servic e1 db = new felcraengine.fe lcracall.Servic e1();
bool tebabo = db.syncTOmysqlc on("INSERT INTO pst_settlers_co ntract_details
(ENTITY, APPLICANT_NO, AGREEMENT_NO, AGREEMENT_STATU S, AGREEMENT_SIGND ATE,
AGREEMENT_TYPE, APPLICANT_STATU S, DATE_EFFECTIVE, STATUS_DATE,
APPLICANT_REPLA CEMENT, OLD_IC_N0, NEW_IC_N0, CREATED_BY, CREATED_DATE,
UPDATED_BY, UPDATED_DATE, UPLOADED, UPLOADED_DATE) VALUES('', '', '', '',
'2005-10-9', '', '', '2005-10-9', '2005-10-9', '', '', '', '', '2005-10-9',
'', '2005-10-9', '', '2005-10-9')");

Thanks in advance!!

--
:: KHAMAL ::

Nov 23 '05 #3
I've got it...when i remove field key in db the data will be inserted smoothly
:: KHAMAL ::
"Khamal" wrote:
hello CG..

what i've got from mysql help is this

You can use ExecuteNonQuery to perform any type of database operation,
however any resultsets returned will not be available. Any output parameters
used in calling a stored procedure will be populated with data and can be
retrieved after execution is complete. For UPDATE, INSERT, and DELETE
statements, the return value is the number of rows affected by the command.
For all other types of statements, the return value is -1.

when invoke actually i got it false....

it is not execute why????
--
:: KHAMAL ::
"CG" wrote:
you are returning an integar, whereas you should return "true" or "false"
bool.

"Khamal" wrote:
What is wrong with this

[WebMethod]
public bool syncTOmysqlcon( string Query)
{
try
{string strConnA = "Database=felcr adb;Data Source=developm ent;User
Id=root;Passwor d=citranet";

MySqlConnection myConnectionstr SQLA = new MySqlConnection (strConnA);
MySqlCommand myCommstrSQLA = new MySqlCommand(Qu ery);
myCommstrSQLA.C onnection = myConnectionstr SQLA;
myConnectionstr SQLA.Open();
int result = myCommstrSQLA.E xecuteNonQuery( );
myCommstrSQLA.C onnection.Close ();
return (result ==1);
}
catch(Exception ex)
{
return DataError(ex);
}

it always error when i call this webservice trough my windows apps.

felcraengine.fe lcracall.Servic e1 db = new felcraengine.fe lcracall.Servic e1();
bool tebabo = db.syncTOmysqlc on("INSERT INTO pst_settlers_co ntract_details
(ENTITY, APPLICANT_NO, AGREEMENT_NO, AGREEMENT_STATU S, AGREEMENT_SIGND ATE,
AGREEMENT_TYPE, APPLICANT_STATU S, DATE_EFFECTIVE, STATUS_DATE,
APPLICANT_REPLA CEMENT, OLD_IC_N0, NEW_IC_N0, CREATED_BY, CREATED_DATE,
UPDATED_BY, UPDATED_DATE, UPLOADED, UPLOADED_DATE) VALUES('', '', '', '',
'2005-10-9', '', '', '2005-10-9', '2005-10-9', '', '', '', '', '2005-10-9',
'', '2005-10-9', '', '2005-10-9')");

Thanks in advance!!

--
:: KHAMAL ::

Nov 23 '05 #4
Khamal,

Your return value is fine, however, I'm not sure what you're doing in
your catch block. It looks like you are returning a value retrieved
from a Function called DataError that you pass the original exception
to. I assuming that this function returns a boolean.

I'm wondering if you are actually getting an exception in one of your
lines of code that is being caught and eaten up by this DataError
function. If this is the case, you may be losing the actual exception
that might give you a better idea as to what is going wrong. Can you
confirm if you are getting an exception or not?

Peter Kelcey

Nov 23 '05 #5
hi peter..

no need to have catch seem like, it will return true or false. May be i
should enable 1 more string for error handling at catch.....if the return
value is false..no dataerror anymore....

if u have any suggestion please feel fee to suggest...

thanks..
--
:: KHAMAL ::
"Peter Kelcey" wrote:
Khamal,

Your return value is fine, however, I'm not sure what you're doing in
your catch block. It looks like you are returning a value retrieved
from a Function called DataError that you pass the original exception
to. I assuming that this function returns a boolean.

I'm wondering if you are actually getting an exception in one of your
lines of code that is being caught and eaten up by this DataError
function. If this is the case, you may be losing the actual exception
that might give you a better idea as to what is going wrong. Can you
confirm if you are getting an exception or not?

Peter Kelcey

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9497
by: ramarnath | last post by:
Problem in sending datatime format to the .net webservice from php. description follows. I've created a .net webservice. ..Net Webservice: <WebMethod()> _ Public Function HelloDate(ByVal mydate As DateTime) As String
3
1419
by: sunnyz | last post by:
hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the data to be stored in Session object so that each user can get its own data.Is this possible in webservice?coz i think it seems to lose the data each time i call the webservice Plz help me in this matter.Its urgent!!! *-----------------------*
1
1554
by: Lauren Quantrell | last post by:
Obviously a newbie question but: Is a .Net app automatically a "SmartClient" app? If I build a frontend in VB.Net or C+.Net and use a SQL Server backend (assuming some sort of ADO.NET involved) is that what MS refers to as a "SmartClient" app? Thanks for any direction on this.
2
2216
by: JDeats | last post by:
I have a WinForms based application that I'm launching over http (Microsoft's buzz word for this is aparently "SmartClient"). I had an issue trying to get parameters passed in through the URL that I thought I had solved. For example, let's say I wanted to do this: http://myserver/appdir/mywinformapp.exe?username=joe&age=12 Providing code access security permissions allow it, mywinformapp.exe is downloaded to the client and launches...
4
1606
by: Razzie | last post by:
Hey all, I have a SOAP envelope with which I try to communicate to a webservice. Everything is fine, but when I try to access a parameter of the webservice method, I get the Object reference not set to an instance of the object error. This is the method: public string query(string type, string someValues)
1
1161
by: sunnyz | last post by:
hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the data to be stored in Session object so that each user can get its own data.Is this possible in webservice?coz i think it seems to lose the data each time i call the webservice Plz help me in this matter.Its urgent!!! *-----------------------*
3
3138
by: pranesh.nayak | last post by:
I'm facing an error:"String was not recognized as a valid DateTime" whille accessing DateTime from webservice. And when I try to set DateTime to the same webservice it fails with error:"Date value is of wrong type" it looks like xs:DateTime is not compatible with .Net DateType. Any suggestions on how to fix this without touching the webservice (3rd party webservice)?
3
1512
by: Ather Ali Shaikh | last post by:
Hello all, I am supposed to develop an e-commerce application integrated with UPS Courier services to calculate the cost of shipment of a products. I have UPS account number also have register a user to download the DevTools, but thos development tools are in VB6.0 and Java, I do not understand that how do I post my request to UPS and get response through ASP.NET 1.1. It has a webservice named LandedCost.wsdl. I think it is a java based...
1
1238
by: Mike | last post by:
Greetings, I have an aspx page where on it is a link that calls my smartclient (a windows form) that opens up. When the user is done in the form, he or she hits a button that saves data and closes the form. I want the smartclient to call the opened browser (IE6 and maybe 7 down the line) and refresh the aspx page. The page contains a datagrid control that gets populated on the page's load event. Does anyone know how you can do that? ...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.