|
Can you tell me what you are referencing while adding the web service. Are you adding sendmailservice3.asmx?wsdl
If so try to connect to sendmainservice3.asmx?disco
Have you tried to browse the disco file directly?
You can also add reference to web service manually.
open Visual studio command prompt,
browse to your application directory
type
disco http://localhost:1446/sendmailservice/sendmailservice3.asmx
this will generate a wsdl file, disco, and discomap file on your disk
Next type
wsdl sendmailservice3.asmx
This will generate the c# file
Now include those files to your project and try to run.
|
|
|
|
|
Hi Abhishek,
I tried adding the things YOU specified but nothing seems to happen all the files were added , but the error still comes.
here is the code along with responses You asked me to Run in visual studio cmd:
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
C:\Program Files\Microsoft Visual Studio 9.0\VC>cd\
C:\>cd C:\Documents and Settings\server\My Documents\Visual Studio 2008\WebSites
\my_project
C:\Documents and Settings\server\My Documents\Visual Studio 2008\WebSites\ my_project >disco http://localhost:1446/SendMailService/SendMailService.asmx
Microsoft (R) Web Services Discovery Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.1432]
Copyright (C) Microsoft Corporation. All rights reserved.
Disco found documents at the following URLs:
http://localhost:1446/SendMailService/SendMailService.asmx?disco
http://localhost:1446/SendMailService/SendMailService.asmx?wsdl
The following files hold the content found at the corresponding URLs:
.\SendMailService.disco <- http://localhost:1446/SendMailService/SendMailServi
ce.asmx?disco
.\SendMailService.wsdl <- http://localhost:1446/SendMailService/SendMailServic
e.asmx?wsdl
The file .\results.discomap holds links to each of these files.
If you would like more help, please type "wsdl /?".
C:\Documents and Settings\server\My Documents\Visual Studio 2008\WebSites\ my_project >wsdl http://localhost:1446/sendmailservice/sendmailservice3.asmx
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.1432]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file 'C:\Documents and Settings\server\My Documents\Visual Studio 2008\W
ebSites\my_project\Service3.cs'.
please reply
|
|
|
|
|
Hi all,
I've been having trouble trying to figure out a way to loop through controls in a User Control to find LoginViews and when found manipulate each of them.
With the following code snippet the LoginView controls are found but cannot be manipulated.
Code:
For Each lv as Control In Me.Controls
If lv.GetType().ToString().Equals("System.Web.UI.WebControls.LoginView") Then
CType(lv, System.Web.UI.WebControls.LoginView).RoleGroups(0).Roles = "role"
End If
Next
Thanks in advance.
|
|
|
|
|
Hi,
I have 3 different Datatable with different coloumns, i want to concatinate with 3 tables into a single table , but i dont want to merge how can achieve this,
datatable1
datatable2
datatable3
1st table 5 columns
2nd table 7 columns
3rd table 3 coloumn
for (i=0 to 3)
{
for(j=0 to datatable1.columns.count-1)
{
dr1[j]=j;
}
for(j=0 to datatable2.columns.count-1)
{
dr2[j]=j;
}
for(j=0 to datatable3.columns.count-1)
{
dr3[j]=j;
}
}
So finally i want to concatinate with the 3 table with 3 rows...
note:
I dont want to merge.. How to do this...
Plz answer me...
thanks in Advance..
kannak......
kannak
|
|
|
|
|
Use this :
DataTable dt = datatable1.clone();
foreach(DataColumn dc in datatable2.Columns)
{
DataColumn dc1 = new DataColumn(dc.Caption,dc.DataType);
dt.Columns.add(dc1);
}
foreach(DataColumn dc in datatable3.Columns)
{
DataColumn dc1 = new DataColumn(dc.Caption,dc.DataType);
dt.Columns.add(dc1);
}
Now to merge the data you need to
for(i=0;i<datatable1.rows.count;i++)
{
DataRow drNew = dt.NewRow();
for(j=0;i<dt.columns.count;j++)
{
if(j< datatable1.Columns.count)
drNew[j] = datatable1.rows[i][j];
else if(j<(datatable1.Columns.count + datatable2.Columns.count))
drNew[j] = datatable2.rows[i][j-datatable1.columns.count-1];
...
}
Finally
dt.Rows.Add(drNew)
You can also make it more cleaner. Also change it according to your need.
Hope it works
|
|
|
|
|
Hi,
In asp.net 3.5, how is it possible to
1)Export the data of a datatable into .csv file
2)Save the spreadsheet on the network as c:\temp\
Thanks
|
|
|
|
|
Check the previous thread.Is that you actually looking for?
Else Google.
|
|
|
|
|
|
why use CSV .. Create Original Excel file rather.
Check this :
http://www.codeproject.com/script/Forums/KB/miscctrl/Excel_data_access.aspx
Hope this will help you.
|
|
|
|
|
Hello all,
In my ASP.Net application, i am transferring GridView contents to a excel file. I am using following code:
string attachment = "attachment; filename=MakeList.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
It was working fine, but as soon as i put this code in try-catch block, i am getting this error:
"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."
If i remove try-catch block, it again works fine.
Can anyone tell me whats the problem? Am i miising something?
Thanks,
Nagendra.
|
|
|
|
|
|
I tried the solution. Now i am not getting any exception but now instead of GridView contents, the whole WebPage is copied in excel file.
I want only GridView contents in excel file.
|
|
|
|
|
What you have done?
I think you removed Response.End().
|
|
|
|
|
Yes, as mentioned in that post, i used "HttpContext.Current.ApplicationInstance.CompleteRequest()" in place of Response.End()
|
|
|
|
|
Hi All My Friends,
I Have 2 problems in a javascript.
1: I am not getting the Item Count Of Dropdown List.
2: I am calling javascript on Button "OnClientClick" event,then also onclick event is fired even script returning false.
Hav a look on Script
function validate()
{
if (document.getElementById("<%=ddlCategories.ClientID%>").selectedIndex == 0) {
alert("Select a Category name !")
document.getElementById("<%=ddlCategories.ClientID%>").focus()
return false;
}
else if (document.getElementById("<%=txtText.ClientID%>").value == "") {
alert("Please fill the Message field !")
document.getElementById("<%=txtText.ClientID%>").focus()
return false;
}
else {
if (SubcategoryCount > 0) {
if (document.getElementById("<%=ddlCategories.ClientID%>").selectedIndex != 0 && document.getElementById("<%=ddlSubCategories.ClientID%>").selectedIndex == 0) {
alert("Select a Sub-Category name !")
return false;
}
}
}
}
|
|
|
|
|
Sachin Dubey wrote: if (SubcategoryCount > 0) {
Where you got this SubcategoryCount from?
Its good if you can make your code little bit readable to the forum readers.
|
|
|
|
|
That is only i asked in first question.. I Have ddlSubCategories in Page
|
|
|
|
|
Sachin Dubey wrote: That is only i asked in first question
that i know.
What i am asking is, in your code you have a line of code like,SubcategoryCount>0,
Whats SubcategoryCount?Is it a global variable?How you are assigning value for that?
|
|
|
|
|
That is not any Variable...That is just i written...
But I want to Use ddlSubcategories.Items.Count in place of SubCategoryCount..
But I Am not Getting the value...
Actually if user doesnt select category then Select Category alert will Prompt..If User Selected Category And There is no Subcategory of that then we allow him to proceed...But if that category has some Sub Categories then its must to Select SubCategory...
Thats what i Want in Else Condition u see...
|
|
|
|
|
Sachin Dubey wrote: That is not any Variable...That is just i written...
How we know its simply written.
Ok.Try ddlSubCategory.options.length
|
|
|
|
|
Thanks Arun I Got The count By :
if (document.getElementById("<%=ddlSubCategories.ClientID%>").options.length > 1)
Now its showing the message also...But Its Saving the record ...
My Code of Button is:
<asp:button id="btnSave" runat="server" text="Save" width="100px" onclientclick="javascript:validate();" onclick="btnSave_Click">
After reading that script it reading On_click event Code...
How to Tackele that..
|
|
|
|
|
Sachin Dubey wrote: OnClientClick="javascript:validate();"
Instead try this,
OnClientClick="return validate();"
|
|
|
|
|
Hey Arun... It Works...
Thanks A Lot....
|
|
|
|
|
Hi,
I am having datatable .. i want to add columns to that , i need to add same column once again ... is it possible ???
if it possible pls let me know the right path ...
for i=0 to 10
datatable.column.add("values to be added")
next
note: it throughs excepttion like , column already exist
thanks,
sekannak...
kannak
|
|
|
|
|
sekannak wrote: . i want to add columns to that , i need to add same column once again
I don't think that your idea is good.If you are trying to add same column again you'll get that error.What you are trying to acheive by adding same column again?
|
|
|
|