|
Hello All,
I have a question,suppose I want to add a web service reference which is developed in asp.net into another plateform e.g.PHP,Java etc... And my web service return dataset or datareader or anything else.
So what the excetly result I'll get.. Is it a XML return ?? or some error found when I add that web service reference.
So if you have any good online tutorial for the web service as advance evel then let me give also.....
Thanks in advance...
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Web services communicates using SOAP messages. So you will get XML format string which matches to SOAP specification[^]. When you add web service through visual studio, it generates a proxy class which take care about converting the raw SOAP message into appropriate data structures (DataSet in your case).
A web service is stateless and it can't return a data reader.
|
|
|
|
|
thanks a lot...
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hello All,
i have list box which have display only 10 item at a time and when user scroll down i have fire one click event through java script and fill next 10 record in list box.
but i have one problem when click event is fire i want to set scroll position at 11 record.
can you please help how it's possible?
Thanks in advance.
Anish Patel
|
|
|
|
|
hi plz help
when i click a delete link in gridview it show error after refreshing it it delete the row "Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified."
where my code in asp.net and C# is like that
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="RecordID" DataSourceID="SqlDataSource1"
style="top: 272px; left: 269px; position: absolute; height: 133px; width: 527px; z-index: 1"
onrowdeleting="Delete">
<Columns>
<asp:BoundField DataField="RecordID" HeaderText="RecordID"
InsertVisible="False" ReadOnly="True" SortExpression="RecordID" />
<asp:BoundField DataField="CouponTypeID" HeaderText="CouponType"
SortExpression="CouponTypeID" />
<asp:BoundField DataField="TransactionDate" HeaderText="Date"
SortExpression="TransactionDate" />
<asp:BoundField DataField="TransactionTypeID" HeaderText="TransactionType"
SortExpression="TransactionTypeID" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
<asp:BoundField DataField="CafeMenu" HeaderText="Menu"
SortExpression="CafeMenu" />
<asp:BoundField DataField="SerialStart" HeaderText="Start"
SortExpression="SerialStart" />
<asp:BoundField DataField="SerialEnd" HeaderText="End"
SortExpression="SerialEnd" />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<span onclick="return confirm('Are you sure to Delete the record?')">
<asp:LinkButton runat="server" ID="lnkDelete" CommandName="Delete" Text="Delete" >
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="ErrorMessage" runat="server"
style="position:absolute; top: 645px; left: 282px; width: 682px; color: #FF9933; font-style: italic;"
Font-Bold="True" ForeColor="#003E3E"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Coupon ManagementConnectionString10 %>"
SelectCommand="SELECT [RecordID], [CouponTypeID], [TransactionDate], [TransactionTypeID], [Description], [CafeMenu], [SerialStart], [SerialEnd], [Price] FROM [CouponTransaction]">
</asp:SqlDataSource>
</asp:Content>
and C# code is
protected void Delete(object sender, GridViewDeleteEventArgs e)
{
try
{
cnx.Open();
SqlCommand mySqlDelete = new SqlCommand("delete from CouponTransaction where RecordID = @recordId", cnx);
mySqlDelete.CommandType = CommandType.Text;
mySqlDelete.Parameters.Add("@recordId", SqlDbType.Int).Value = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
mySqlDelete.ExecuteNonQuery();
ErrorMessage.Text = " Row Deleted Successfully";
cnx.Close();
}
catch (Exception ex)
{
ErrorMessage.Text = ex.Message;
}
}
|
|
|
|
|
haleemasher wrote: "Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified."
Its means, you are trying to delete records, without specifying the Delete Command with your SQL DataSouce. Please Provide the DeleteCommand and Try it again !
|
|
|
|
|
i have done it plz chk my code
|
|
|
|
|
No, you need to define it on the SqlDataSource. Look at your original post - you supply a SelectCommand but no DeleteCommand.
|
|
|
|
|
Solution:
U should make a bit changes at:
<asp:LinkButton runat="server" ID="lnkDelete" CommandName="Delete" Text="Delete" > </asp:LinkButton>
*1st: don't use default CommandName="delete" , i choosed CommandName="xoa"
*2nd: use RowCommand event instead of Delete event
eg:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
switch (e.CommandName)
{
case "xoa":
(new Report()).DeleteBy(e.CommandArgument.ToString());
RefreshList();
break;
case "sua":
//Report _rpt = Report.GetReportById(e.CommandArgument.ToString());
break;
}
}
catch (System.Exception ex)
{
ShowWarningMessage(ex.Message);
}
}
-------END----
|
|
|
|
|
Hi All,
I have created a menu by writing html in C# code. I have used
|
|
|
|
|
i created a checkbox dynamicaly, and added it to the web form ,it id displayed in the form ,but when the state is changed the event is not fired.
public class checkbox:CheckBox
{
CheckBox chkbx;
public checkbox()
{
chkbx = new CheckBox();
chkbx.ID = "chk1";
chkbx.Attributes["runat"] = "server";
chkbx.AutoPostBack = true;
chkbx.CheckedChanged += new EventHandler(myclick);
Controls.Add(chkbx);
}
public void myclick(object sender, EventArgs e)
{
{
if (chkbx.Checked)
{
chkbx.Text = "checked";
}
}
}
}
this is on the form
protected void Page_Load(object sender, EventArgs e)
{
checkbox cbx = new checkbox();
form1.Controls.Add(cbx);
}
any one got any idea why this is not functioning well ?
|
|
|
|
|
You need to read more about view states and ASP.NET page life cycle. ASP.NET will not maintain view state for controls which are created inside page_load . Try some event which occurs before view state is saved. Init is one option.
|
|
|
|
|
How can i detect bluetooth device and transfer the data from Pocket PC in C#
|
|
|
|
|
nithydurai wrote: How can i detect bluetooth device and transfer the data from Pocket PC in C#
This is ASP.NET Forum. There is nothing to do with it in ASP.NET. You should ask it in C# Forum.
|
|
|
|
|
Hi all,
Does anyone know of how to (or point me to some information on how to) send and email using X.509 PKI with attachments. There are a lot of posts around the Internet on using X.509 without attachments but it fails for emails with attachments.
I would like to do this myself with native C# code and not use a third party product if possible.
Thanks,
Maurice
|
|
|
|
|
Hi all.
So here is my problem. The application is hosted in Windows Server 2008 with IIS7.
I have a button (from Silverlight page) that calls a new webpage (asp.net page, ext .aspx) that contains Response.OutputStream.Write(blahblahblah) which then should prompt a download box to allow user to save an image.
Now the page basically creates a stream and then is supposed to output the stream to the user using Response.Outputstream.Write.
Then the user is supposed to be prompted to open or save the document. This works fine in Firefox but it does not work with IE7 or 8
Also this exact same code works with IIS6 on a Windows 2003 server.
So the only differences is the IIS6 and Windows 2003 Server to IIS7 and Windows 2008 Server.
And what happens is when I clicked the button, the page did pop up but disappear 1-2 seconds later without prompting the download box to the user.
Here is the code that launches for Reference
//e.g file = 123424_43535.jpeg
FileInfo myFile = new FileInfo(Server.MapPath("mapImage/") + file;
using(var fs = myFile.Open(FileMode.Open, FileAccess.Read))
{
byte[] buffer;
int read;
buffer = new byte[(int)fs.Length];
Response.AddHeader("Content-Disposition", "attachment;filename=" + file);
Response.ContentType = "application/x-force-download";
Response.AddHeader("Connection", "Keep-Alive");
Response.AddHeader("Content-Length", fs.Length.ToString());
while((read = fs.Read(buffer, 0, buffer.Length)) > 0)
{
this.Response.OutputStream.Write(buffer, 0, read);
}
}
Response.End();
I have tried to replace Response.AddHeader with Response.AppendHeader, however the result is still the same.
Also, I have tried to replace the Response.ContentType with application/octet-stream and image/jpeg, I also faced the same result.
Is there any setting/modification on server/code that I need to look on?
This problem has bugged me for a long period and a quick reply/solution will be very much appreciated.
Thanks and have a nice day.
Regards,
Kent
|
|
|
|
|
Hi,
In my gridview i have added the following field to view (summary) of a particular order number.
<asp:buttonfield buttontype="Link" runat="server" text="View" commandname="View">
The summary is displayed in the same page. I have used rowcommand event of gridview for the control.
My code works well but i want to change the text of control from view to *view once it is clicked so that one recognizes the order that is being viewed.
I tried searching but am not sure as wat to search. Please provide guidence in this regards.
Thankyou
|
|
|
|
|
hello
I want to upload specific file on the disk thus I try to set the File textbox field without having to click on the browse button but I have failed I use this line
so I create another textbox
and button to upload the file from textbox
this attempt create file in the uploadfolder its name is test but empty file
so any Ideas
thanks in advance
|
|
|
|
|
how can I create custom dropdownlist ( inherited from standard dropdownlist) with 4 default items?
I can inherit from dropdownlist but I dont know how I can add this items
|
|
|
|
|
mohandesmehran wrote: how can I create custom dropdownlist ( inherited from standard dropdownlist) with 4 default items?
You want to create a custom drop downlist only to have 4 default items?
Well, add the items in the constructor of the inherted class.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
|
I need a person that will interstingly join me in my quest to develop www.runningcodes.net and making it a dream come true. as at now my major challenge is the connectionstring. i am using aspnetdb.mdf as for my site.http://www.codeproject.com/script/Forums/Images/smiley_confused.gif
|
|
|
|
|
Basically what are u trying to do ?
why anyone will help you in your task ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Sandeep Akhare wrote: why anyone will help you in your task ?
Because he is
|
|
|
|