|
This is the first I've used a Web service and I'm having some trouble in getting the return data from the service I'm calling.
The Service is defined as follows:
Public Function CheckSeats(ByVal scheduleID As String) As Data.DataTable
And I consume it as follows:
Enrolment.EnrolmentService MyEnrol = new Enrolment.EnrolmentService();
seatTable = DMyEnrol.CheckSeats(Session["CourseID"].ToString());
Where seataTable is declared as a System.Data.DataTable.
I get the following error however when I try and build the solution:
Error 2 Cannot convert type 'Enrolment.CheckSeatsResponseCheckSeatsResult' to 'System.Data.DataTable' C:\Inetpub\wwwroot\_site_v02_04\_site_v02_04\content\SearchResults.aspx.cs 136 25 C:\...\_site_v02_04\
Can anyone tell me how to solve this problem?
|
|
|
|
|
You have to dig into the automated code of the proxy that (I suppose) Visual Studio has generated for you.
It is generated from WSDL, which in turn is generated automatically by Visual Studio again when the asmx was compiled.
You should check the WSDL definition of the method, and you should find that the method does return "Enrolment.CheckSeatsResponseCheckSeatsResult" (you can see it as a tag).
Now: proxy is generated to interpret SOAP and XML as they come from your WS, using Attributes (in C#). If you take a look at the attributes you should see that the method is expeted to return such class (that is: intercept that tag). You should also see the definition for CheckSeatsResponseCheckSeatsResult (either as class or tag) and seeing all this you have the opportunity to dim in which point originary DataTable definition was loose.
A trick I can suggest you is to generate proxy dll with C#: it give you more control over the deserialization of XmlResponse from WS.
I am assuming you are conusming your own webservice.
Another trick which may work is to use the IDataTable interface instead of DataTable class. This does not affect automatic serialization but may restrict opportunities of "fancy" code by autogeneration.
Hope this should help
Parsiphal
|
|
|
|
|
I am trying to make copy a text feature by using Javascriot and I wrote a function for it::
function copyData(field)
{
field.focus();
field.select()
Copied = field.createTextRange();
Copied.execCommand("Copy");
}
But it works in IE only, I want to get it worked in Mozilla, Firefox and Netscape too. What changes should I make for that??
I've used setSelectionRange(start,end) instead of createTextRange(), it only selects the text from the range from 'start' to 'end' but doesn't copy it.
Kindly Suggest!!
ANUJ
|
|
|
|
|
|
I had that problem myself. I have a time field and when i was clicking on Hour/minutes/second, i wanted the 2 representative digit to be selected depending on the position of the click.
My code obviouly didn't work on Firefox as usual
I found on the web the following code to solve the problem:
function insertAtCursor(myField, myValue)
{
if (document.selection)
{
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
sel.moveStart(’character’, -myValue.length);
sel.select();
}
else if (myField.selectionStart || myField.selectionStart == ‘0′)
{
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value =
myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
myField.selectionStart = startPos;
myField.selectionEnd = startPos + myValue.length;
}
|
|
|
|
|
hi,
i have a dropdownlist.in this ddl i want to place the grid how is it possible?here i want to perform all the operations that can be performed on normal grid i.e., outside the the ddl.
now i want to perform the operations on the grid which is inside the ddl
|
|
|
|
|
you can't have a grid inside a drop down list, its rendered as a element which can only have or children
|
|
|
|
|
Hi all,
I want to add the selected element from one listbox to another listbox and remove also on button click event >(button text for add) and <(button text for remove).
Also I need to add all the element from one listbox to another and remove also on button click event >>(button text for add all) and <<(button text for remove all).
I want to do this with Javascript.
Please help me as I have to do this by today.
Thanks in advance.
|
|
|
|
|
Hi try this out it may help u
var conAdd = 'Add';
var conRemove = 'Remove';
var delimiter = "|";
function MoveOption(f, From, To, action)
{
var eFrom = eval('f.msb' + From);
var eTo = eval('f.msb' + To);
var selection = eFrom.options.selectedIndex;
var eAddContainer;
var eRemoveContainer;
if (action == conAdd)
{
eAddContainer = eval('f.htx' + conAdd + To);
eRemoveContainer = eval('f.htx' + conRemove + To);
}
if (action == conRemove)
{
eAddContainer = eval('f.htx' + conRemove + From);
eRemoveContainer = eval('f.htx' + conAdd + From);
}
if (selection == -1)
{
alert("Please select one or more users to move.");
}
else
{
eval('f.cmd' + action + '.disabled = true;');
for (i = 0; i < eFrom.options.length; i++)
{
if(eFrom.options[i].selected)
{
var name = eFrom.options[i].text;
var ID = eFrom.options[i].value;
eFrom.options[i] = null;
eTo.options[eTo.options.length] = new Option (name,ID);
i = i - 1;
var rep = new String('\\' + delimiter + ID + '\\' + delimiter + '');
var repExp = new RegExp(rep);
}
}
}
}
function onChange_msbUserPool(f)
{
f.cmdAdd.disabled = (f.msbUserPool.selectedIndex == -1);
}
function onChange_msbAssignedUser(f)
{
f.cmdRemove.disabled = (f.msbAssignedUser.selectedIndex == -1);
}
function moveup(list)
{
var daflag = false
for (var i = 0; i <= list.options.length-1; i++) {
if (!list[i].selected) {
daflag = true
}
if (list[i].selected && daflag) {
list.insertBefore(list[i],list[i-1])
}
}
}
function test()
{
newtest();
}
function movedown(list)
{
var daflag = false
for (var i = list.options.length-1; i >= 0; i--) {
if (!list[i].selected) {
daflag = true
}
if (list[i].selected && daflag) {
list.insertBefore(list[i],list[i+2])
}
}
}
All Element | Selected Elements |
1
2
3
4
5
|
|
|
|
|
|
UP
Down
|
SP
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
Thanks for the reply sir. I got some code but its not working I am not able to track whats wrong.
<html>
<head>
<script language="JavaScript">
function f_optionMove(s_from, s_to)
{
alert(s_from);
var e_from = document.forms['test_form'].elements[s_from],e_to = document.forms['test_form'].elements[s_to];
alert(e_from);
if (!e_from)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
var n_moved = 0;
for (var i = 0; i < e_from.options.length; i++)
{
if (e_from.options.selected)
{
e_to.options[e_to.options.length] = new Option(e_from.options.text, e_from.options.value);
n_moved++;
}
else if (n_moved)
e_from.options[i - n_moved] = new Option(e_from.options.text, e_from.options.value);
}
if (n_moved)
e_from.options.length = e_from.options.length - n_moved;
else
alert("You haven't selected any options");
}
function f_optionMoveAll(s_from, s_to)
{
var e_from = document.forms['test_form'].elements[s_from],e_to = document.forms['test_form'].elements[s_to];
if (!e_from)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
e_to.options.length = 0;
for (var i = 0; i < e_from.options.length; i++)
e_to.options = new Option(e_from.options.text, e_from.options.value);
e_from.options.length = 0;
}
function f_selectAll (s_select)
{
var e_select = document.forms['test_form'].elements[s_select];
for (var i = 0; i < e_select.options.length; i++)
e_select.options.selected = true;
}
</script>
</head>
<body>
<form id="test_form" name="test_form" runat="server">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td>
<select multiple name="source" style="width: 170px; height: 170px">
<option>Vishal</option>
<option>Pooja</option>
<option>Dnyandeo</option>
<option>Varsha</option>
<option>Aditi</option>
<option>Nilesh</option>
</select>
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td>
<input type="Button" style="width: 200px;" value="Add Selected >>" onclick="f_optionMove('source', 'destination')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Remove Selected <<" onclick="f_optionMove('destination', 'source')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Add All >>" onclick="f_optionMoveAll('source', 'destination')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Remove All <<" onclick="f_optionMoveAll('destination', 'source')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Select All Sources" onclick="f_selectAll('source')"></td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Select All Destinations;" onclick="f_selectAll('destination')"></td>
</tr>
</table>
</td>
<td>
<select multiple name="destination" style="width: 170px; height: 170px">
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
Please tell me where I am going wrong.
|
|
|
|
|
hi all,
has anybody an idea how can i customize the design of my media player?
and is there also an reference how can i controll the mediaplayer from javascript ?
greetings gigo
|
|
|
|
|
media player is not the most flexible utility to use when displaying interactive content. You would be better off using a flash client.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
|
Hello all,
I have designed a dropdown menu with simple javascript code but actually when disabling the "javascript" property from IE, the menu doesn't work. instead i found this site: "http://www.redballoondays.com.au/" which has same dropdown and it works even if i disabled the javascript property from IE.
So can anyone help me in running me menu even if the javascript is disabled in IE.
Thank you
|
|
|
|
|
That website is using CSS rather than javascript for the menu (a much better way). Theres plenty of examples out there on how to do this (I think the dynamic drive site has a few)
|
|
|
|
|
what about this?? this is the script used by the website
but if you have examples for using css in dropdown menus, please mention one
Thank you
<![CDATA[//><!]]>
|
|
|
|
|
My bad, it does use CSS but it only works in Firefox, that script is for IE. I tried the site in IE with javascript turned off though and it didn't work. It is possible to use a pure CSS solution for both IE and Firefox, like I said search for it on google there are examples out there (bear in mind that a lot of them won't work in both!).
Heres one source for starters:
http://www.dynamicdrive.com/style/
|
|
|
|
|
Hi
I m developing a web portal in c# asp.net web application .i want to built an email client.My email client will include the functionalty as
Making new account
sending e mail with attachments
receiving email with inbox maintaing facility. etc
but i have not any idea about it. Can any one guide us first of all about the email server that which server should b used 2ndly how it can be used n from where v can get help regading its builtin methods to b used in email client.
v want help in C# not in HTML codin
Thanx
|
|
|
|
|
From what I remember the the .NEt framework has support for IIS's SMTP server.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hi Guys
I am supporting an ASP application, there is a form in this application which have more than 300 fields. Now sometime data fails at the time of submission. There are 6 screens and session variable are being used to save form data temporarily and move between the screens.
Is there any other way to handle such a huge form?
Please do reply ASAP
Thanks
Ajit Singh
|
|
|
|
|
A 300 field form is a usabillity nightmare. I'd break it up into multiple forms, perhaps as a wizard ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
True. It would for sure send chill waves down the spine for the user though.
|
|
|
|
|
I made a test a while back on how many fields you could have in a form, and it showed that somewhere around 100 fields the browser started acting up. IIRC that was IE 5.0 on Windows 98, so newer browsers in newer operating sytems probably have a higher limit. Still, the limit is not very high, so it's quite possible that you have more fields in the form than the browser can handle.
The way to handle such a huge form is not to. Split it up in smaller forms.
---
Year happy = new Year(2007);
|
|
|
|
|
Hello All
I need to send email using Binary SOAP. I used DIME but i realised that
it only send attachment by binary soap, though my requirement is that i
need to send attachment AND the enter email attributes(user's and receipient
email, message, subject line). can anyone tell me how can i have this done and
which technique to use for sending all these attributes using Binary SOAP.
BEST !!
Ankit Sharma
|
|
|
|
|