but i cnt get output in gridview; pls correct my codings and tel me what i want to add extra here...
and tel me web.config what i want to add and also in asp source ?
i want output http://www.ticketgoose.com goto this site and in leftside choose from place toplace and date and give search the output eill displays i want to bring exact that output in my form when i give fromplace
toplace and date give search means ? give give me solution
I assume that you want to consume a webservice. If I am right, the please consume the webservice by the following code.
HttpWebRequest request = null;
HttpWebResponse response = null;
string result = "";
string Xml = "";
try
{
// Create the web request
string url = "http://staging.ticketgoose.com/bookbustickets/services/TGSWS" + "?code=dblsl&message=dblsl2012";
request = WebRequest.Create(url) as HttpWebRequest;
// Get response
using (response = request.GetResponse() as HttpWebResponse)
{
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream());
Xml = reader.ReadToEnd();
}
result = Xml;
}
catch (Exception exp)
{
throw (exp);
}
Just put debugger point in result at last. Then you will see that you have get some value in html format. Remove html tag and use your desired value as you like. If you want to use dropdownlist or grid make a list for this. Make sure your internet is connected
because you consumed a webservice. Few days ago, I solved the same problem. He also tried to consume the same webservice. I have put code and message as my own. You can put correct code and message. Hopefully this should work.
i give like this... right click solution explorer and then click Add Service Reference. in url i paste this url
http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl and give ok and namespace is servicereference; i am use namespace like this using ServiceReference; and i run means it
show error like this... what will i do ?
Error: Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.
My code is :
protected void Button1_Click(object sender, EventArgs e)
{
using (var svcClient = new TGTravelServiceClient()) {
svcClient.Endpoint.Address = new EndpointAddress("http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl");
var tripDetails = svcClient.getTripDetailsV2("userId", "pwd", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");
maddyrafi897...
Member
134 Points
300 Posts
can anybody help me what error in my code
May 02, 2012 05:46 AM|LINK
First i add webreference in my project the url is http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl
and namespace is using com.ticketgoose.staging;
in default.aspx:
protected void Button1_Click(object sender, EventArgs e)
{
TGTravelServiceService ts = new TGTravelServiceService();
ts.getStationList("maddyrafi@gmail.com", "samerafi");
GridView1.DataSource = (TextBox1.Text,TextBox2.Text,TextBox3.Text);
GridView1.DataBind();
}
but i cnt get output in gridview; pls correct my codings and tel me what i want to add extra here...
and tel me web.config what i want to add and also in asp source ?
i want output http://www.ticketgoose.com goto this site and in leftside choose from place toplace and date and give search the output eill displays i want to bring exact that output in my form when i give fromplace toplace and date give search means ? give give me solution
rio.jones
Member
246 Points
53 Posts
Re: can anybody help me what error in my code
May 02, 2012 09:45 AM|LINK
You are calling using ts.getStationList("maddyrafi@gmail.com", "samerafi");
but not binding text from text box. Not getting how you are binding data to gridview.
mahedee
Member
450 Points
116 Posts
Re: can anybody help me what error in my code
May 02, 2012 09:59 AM|LINK
I assume that you want to consume a webservice. If I am right, the please consume the webservice by the following code.
HttpWebRequest request = null; HttpWebResponse response = null; string result = ""; string Xml = ""; try { // Create the web request string url = "http://staging.ticketgoose.com/bookbustickets/services/TGSWS" + "?code=dblsl&message=dblsl2012"; request = WebRequest.Create(url) as HttpWebRequest; // Get response using (response = request.GetResponse() as HttpWebResponse) { // Get the response stream StreamReader reader = new StreamReader(response.GetResponseStream()); Xml = reader.ReadToEnd(); } result = Xml; } catch (Exception exp) { throw (exp); }Just put debugger point in result at last. Then you will see that you have get some value in html format. Remove html tag and use your desired value as you like. If you want to use dropdownlist or grid make a list for this. Make sure your internet is connected because you consumed a webservice. Few days ago, I solved the same problem. He also tried to consume the same webservice. I have put code and message as my own. You can put correct code and message. Hopefully this should work.
Mahedee
Blog: http://mahedee.blogspot.com
maddyrafi897...
Member
134 Points
300 Posts
Re: can anybody help me what error in my code
May 02, 2012 10:04 AM|LINK
Where i want to write this code ? in default.aspx ? or webservice.asmx,
maddyrafi897...
Member
134 Points
300 Posts
Re: can anybody help me what error in my code
May 02, 2012 10:05 AM|LINK
is this code isa errror ? i do like this only ...
i give like this... right click solution explorer and then click Add Service Reference. in url i paste this url http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl and give ok and namespace is servicereference; i am use namespace like this using ServiceReference; and i run means it show error like this... what will i do ?
Error: Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.
My code is :
protected void Button1_Click(object sender, EventArgs e)
{
using (var svcClient = new TGTravelServiceClient())
{
svcClient.Endpoint.Address = new EndpointAddress("http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl");
var tripDetails = svcClient.getTripDetailsV2("userId", "pwd", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");
GridView1.DataSource = tripDetails.ToList();
GridView1.DataBind();
}
}
Now what will i do ? pls give me solution pls...
</div>sriramabi
Contributor
4351 Points
1277 Posts
Re: can anybody help me what error in my code
May 02, 2012 10:13 AM|LINK
Hai
pls change this way.....
maddyrafi897...
Member
134 Points
300 Posts
Re: can anybody help me what error in my code
May 02, 2012 10:16 AM|LINK
i cnt understand which code instead of i change this code ? can you tel clearly pls ?
sriramabi
Contributor
4351 Points
1277 Posts
Re: can anybody help me what error in my code
May 02, 2012 10:17 AM|LINK
Pls u can try mi first post .its not use then check
var tripDetails = svcClient.getTripDetailsV2("userId", "pwd", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");
i think this line return only one but u bind gridview so u get this error....
thank u
sriramabi
Contributor
4351 Points
1277 Posts
Re: can anybody help me what error in my code
May 02, 2012 10:20 AM|LINK
hai
change u r code
maddyrafi897...
Member
134 Points
300 Posts
Re: can anybody help me what error in my code
May 02, 2012 10:22 AM|LINK
In
in this where i can replace your code ?
protected void Button1_Click(objectsender, EventArgs e)
{
using (var svcClient = newTGTravelServiceClient())
{
svcClient.Endpoint.Address =new EndpointAddress(http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl);
var tripDetails = svcClient.getTripDetailsV2("maddyrafi@gmail.com", "samerafi", "originStationId", "destinationStationId", "01/05/2012", "scheduleId");
GridView1.DataSource = tripDetails.ToList();
GridView1.DataBind();
}
}
This is your code :
IMultipleResults results = les.sp_client_report_downtime(1, "April", "2011", null, "histogram");
IEnumerable<sp_client_report_downtimeResult> res = results.GetResult<sp_client_report_downtimeResult>();
machinwiseDowntime.DataSource = res;