|
These projects are not written by the same people. If you want something that can do that, you'd have to get a hold of all the APIs and create a wrapper around them that would broker your data to each using the appropriate interfaces. That way it could appear to be a single API, but in reality I don't think it would exist as you want it to.
|
|
|
|
|
Hi,
I am new to web service... I have created a simple web service to add a record to sql server by passing a parameter and returns true or false once done...
At the same time, I want to return the customer_account_number value created on the sql server.. so basically I want to return the true and false and one (or more) additional values..
how can i do that please..
|
|
|
|
|
how about returning a struct?
|
|
|
|
|
any example there for the web services?
|
|
|
|
|
You need to create a struct with both values
public struct ServiceReturnArgs
{
public string id;
public bool result;
}
then serialize it and send the resulting string as the return value from the webmethod.
Deserialize on the consumer and voila, you have your results.
|
|
|
|
|
Basically, you have two options.
One create you own custom datatype, having as many properties as you want, and return the object of that.
Another approach would be,passing a ref parameter define webmethod
parameters, like
[WebMethod]
public string myMethod(string Id, ref int status)
{
status = 3;
return "result";
}
Now you will both the values at client.
|
|
|
|
|
Hi,
I am new to web service... I have created one web service using ASP.NET to insert a record in my sql server by passing one parameter.
my question, when user type the web service address in the browser address textbox it will show him what are the parameters to enter then he can enter there..
what if I don't want this happen? I just want user to be able to pass the parameters through my application only?
how can I protect the web service then?
|
|
|
|
|
|
I have 2 user groups say LDM and DM
In DM there are 3 users.If any of the DM approves the page status is completed.
LDM send a form for Review with status Inprogress and DM reviews it and the status is changed to Reviewed.
How to handle this in workflow using a form.Can this be a layout
SNO Workflow seq PAGE PAGE SENT FOR REVIEW Assigned to If Reject Go to Email
EDIT CHECKS
1 Assigned Edit Check Customization Edit Check Customization Role: -1 yes
Assign User:
2 Assigned Edit check Review Edit check Review Assigned users: 1 Yes
If anyone approves change status to completed
FEC
1 Inprogress FEC FEC Role: -1 yes
Assign User:
2 Reviewed FEC REVIEW FEC REVIEW Assigned users 1 Yes
If anyone approves change status to completed
|
|
|
|
|
I wanna run outlook on client,just like input "D:\PROGRA~1\MICROS~4\Office12\OUTLOOK.EXE" into run.
I don't want to use "mailto:",how can I do?
|
|
|
|
|
magichi wrote: I wanna run outlook on client,just like input "D:\PROGRA~1\MICROS~4\Office12\OUTLOOK.EXE" into run.
Are you working on web application. And want to run outlook on client machine. You can not. Because browser does not have suffcient permission to run an exe on a machine.
|
|
|
|
|
Try this
using System.Diagnostics;
Process.Start("outlook.exe");
|
|
|
|
|
I tried it,but it doesn't work.
somebody says the reason is it's server code,not client code,so it doesn't work
|
|
|
|
|
Another one
function go()
{
w = new ActiveXObject("WScript.Shell");
w.run('notepad.exe');
return true;
}
onLoad="go();" event in form
|
|
|
|
|
I tried it,but it based on the security of IE option.It based on setting low security.Customs could not set same security of IE.
|
|
|
|
|
magichi wrote: I don't want to use "mailto:
Why?
magichi wrote: I wanna run outlook on client,just like input "D:\PROGRA~1\MICROS~4\Office12\OUTLOOK.EXE" into run
Think about it - what happens if the user doesn't have Outlook installed? What if it's installed to a different location?
You are writing a web based application, which users expect to honour the security sandbox. Solutions like shelling out using ActiveX scripting have the effect of giving users and experience they wouldn't expect, probably wouldn't like, and certainly won't work on none Microsoft operating systems.
|
|
|
|
|
yeah,somebody have suggest me to use ActiveX,do u have any example?
|
|
|
|
|
You might be looking into <a href="mailto:email@domain.com">open outlook new mail window</a>
For details, click here[^]
|
|
|
|
|
Like Pete said... Respect the security sandbox.
That being said, I have in a closed intranet setting implemented solutions that intertwine both client based binaries and server based web pages. But only in a closed intranet setting where that can be properly administered and controlled would that be something to be considered.
If the purpose is to launch the user's outlook, that is what the mailto directive was created for. A safe way to launch a user's email system from a web app.
|
|
|
|
|
Customs wanna open outlook just like run outlook on their client.They don't wanna see the send mail box,they wanna see the number of unread mails,or other information that could see when they open the outlook.How could I do?
|
|
|
|
|
magichi wrote: Customs wanna
Please use full words when you write here. It's truly painful for some of us older guys to read stuff like this.
magichi wrote: They don't wanna see the send mail box,they wanna see the number of unread mails,or other information that could see when they open the outloo
If they are using outlook and an exchange server, just have the exchange server admins activate the webmail front end??? I think that is what you want.
|
|
|
|
|
Hi,
when I execute this code i get the following error:Incorrect syntax near the keyword When.
StringBuilder sb = new StringBuilder();
foreach (GridViewRow row in GridView1.Rows)
{
string note1 = (row.FindControl("note1") as TextBox).Text.Replace(",", ".");
string note2 = (row.FindControl("note2") as TextBox).Text.Replace(",", ".");
string userID = (row.FindControl("lblUserID1") as Label).Text;
sb.AppendFormat(
@"UPDATE EXAMEN
SET NOTE = case when
CODE_MATIERE ='111' then {0}
when CODE_MATIERE ='112' then {1}
END
where NUM_INSCRIPTION = {2}
;
", note1, note2, userID);
}
</pre>
|
|
|
|
|
You need to enclose your CASE statement in brackets:
UPDATE EXAMEN
SET NOTE =
( CASE
WHEN CODE_MATIERE = '111' THEN '{0}'
WHEN CODE_MATIERE = '112' THEN '{1}'
END )
WHERE NUM_INSCRIPTION = {2};
I would also recommend using a parameterised update query - that way you only need to create the query once and you can pass the row-specific values (note1 , note2 , userId ) as parameters.
|
|
|
|
|
You cannot have CR/LF in strings. Thus you have to concatenate your strings if you want to write them on several lines :
sb.AppendFormat(
@"UPDATE EXAMEN "
+ "SET NOTE = "
+ "(CASE "
+ "WHEN CODE_MATIERE = '111' then {0} "
+ "WHEN CODE_MATIERE = '112' then {1} "
+ "END) "
+ "WHERE NUM_INSCRIPTION = {2};"
, note1, note2, userID);
An even better option would be to use a parameterized query :
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "UPDATE EXAMEN "
+ "SET NOTE = "
+ "(CASE "
+ "WHEN CODE_MATIERE = '111' then @note1 "
+ "WHEN CODE_MATIERE = '112' then @note2 "
+ "END) "
+ "WHERE NUM_INSCRIPTION = @numinsc;"
SqlParameter param1 = new SqlParameter("note1", note1);
cmd.Parameters.Add(param1);
SqlParameter param2 = new SqlParameter("note2", note2);
cmd.Parameters.Add(param2);
SqlParameter param3 = new SqlParameter("numinsc", userID);
cmd.Parameters.Add(param3);
...
Edit : I replied to the wrong post. Sorry
|
|
|
|
|
Hi; Thak you phil.o
I tried using a parameterized query but it does not work:It update with zero all marks
foreach (GridViewRow row in GridView1.Rows)<br />
{<br />
TextBox notem1 = row.FindControl("note1") as TextBox;<br />
TextBox notem2 = row.FindControl("note2") as TextBox;<br />
Label num = row.FindControl("lblUserID1") as Label;<br />
SqlConnection myConnection = new SqlConnection(ConnectionString);<br />
<br />
SqlCommand myCommand = new SqlCommand(<br />
"UPDATE EXAMEN "<br />
+ "SET NOTE = "<br />
+ "(CASE "<br />
+ "WHEN CODE_MATIERE = '111' then @note1 "<br />
+ "WHEN CODE_MATIERE = '112' then @note2 "<br />
+ "END) "<br />
+ "WHERE NUM_INSCRIPTION = @num;"<br />
<br />
<br />
, myConnection);<br />
<br />
myCommand.Parameters.Add(new SqlParameter("@num", SqlDbType.VarChar, 4));<br />
<br />
myCommand.Parameters["@num"].Value = num.Text;<br />
myCommand.Parameters.Add(new SqlParameter("@note1", SqlDbType.Float, 2));<br />
<br />
myCommand.Parameters["@note1"].Value = notem1.Text.Replace(",", ".");<br />
<br />
<br />
myCommand.Parameters.Add(new SqlParameter("@note2", SqlDbType.Float, 2));<br />
<br />
myCommand.Parameters["@note2"].Value = notem2.Text.Replace(",", ".");<br />
myConnection.Open();<br />
<br />
myCommand.ExecuteNonQuery();<br />
<br />
myConnection.Close();<br />
<br />
}
modified on Thursday, October 14, 2010 6:21 AM
|
|
|
|