ASP.NET - Dataset Error

Asked By Jahir on 12-May-12 09:17 AM
Earn up to 30 extra points for answering this tough question.

I add web reference and this is my API: http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl

my code:

protected void Button1_Click(object sender, EventArgs e)

{

TGTravelServiceService ts = new TGTravelServiceService();

var data = ts.getStationList("maddyrafi@gmail.com", "samerafi");

GridView1.DataSource = data.stationList;

GridView1.DataBind();

}

Here Dataset showing Empty In output

my gridview code:

<EmptyDataTemplate>No Records Found Maddy ! ! !</EmptyDataTemplate>

<Columns>

<asp:TemplateField HeaderText="originStationId">

<ItemTemplate>

<asp:Label ID="lbltour" runat="server" Text='<%#Eval("originStationId") %>' ></asp:Label></ItemTemplate > </asp:TemplateField>

<asp:TemplateField HeaderText="destinationStationId">

<ItemTemplate>

<asp:Label ID="lbltour" runat="server" Text='<%#Eval("destinationStationId") %>' > </asp:Label></ItemTemplate ></asp:TemplateField> </Columns>

The output shows Empty Dataset No REcords Found... What i do ? how to clear this error ?

C D replied to Jahir on 12-May-12 09:25 AM

Hello,

Because your StationDatalist is null.

 

 

Hope this helpful!

Thanks

 

 

 

Jahir replied to C D on 12-May-12 09:32 AM

http://staging.ticketgoose.com/bookbustickets/services/TGSWS?wsdl

this is my API i get that stationlist is from here... how to bring correct output here ?

[)ia6l0 iii replied to Jahir on 12-May-12 10:11 AM
I added a webreference and checked the data response. If you carefully see, the data.status.message returns the error code for the operation that you are trying to do. 

In this case, the error thrown is "One of access key parameter contain special characters". Please look below.



Reach out to the api owners. 

Hope this helps.
Jitendra Faye replied to Jahir on 12-May-12 10:24 PM
Yes, if you are using this code then it is returning null as result. I think this is because of username and password which you are passing in this line- var data = ts.getStationList("maddyrafi@gmail.com", "samerafi"); Check with your given username and password.
Jahir replied to [)ia6l0 iii on 14-May-12 12:39 AM
without conducting webservice manager how you get this output, i want also like that only... so pls tel me the step procedure what i want to do ? to bring output pls
Jahir replied to Jitendra Faye on 14-May-12 12:42 AM
username and password is correct i am given here,how to get this output, so pls tel me the step procedure what i want to do ? to bring output pls
Jahir replied to [)ia6l0 iii on 14-May-12 12:43 AM
so what i do for this error ? i am getting this type error so what i do ?
Jitendra Faye replied to Jahir on 14-May-12 10:46 AM
I have added reference of given service and I also didn't get any record related to data.stationList.

See this image-




In this returned result there is no stationlist object.
[)ia6l0 iii replied to Jahir on 14-May-12 11:34 AM
The webservice returns the "Code" and "Message" properties to indicate the error. Lookup the SDK of the web service, or contact the provider with the error message , I have shown in the screenshot. 

Also note that , as the above member suggests, triplist is null. But it is not because there are no "stations", always ensure that you read the "status" before you arrive at any conclusion. 
help
Null Error ASP.NET 28-Oct-12 07:32 PM in this API http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl i am getting null error in getstationlist I add web reference and this is my API: http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl my code: protected void Button1_Click( object sender, EventArgs e TGTravelServiceService ts = new TGTravelServiceService (); var data = ts.getStationList( "maddyrafi@gmail.com" , "samerafi" ); / / here i am getting null GridView1.DataSource = data. stationList ;null error GridView1.DataBind(); } Here Dataset showing Empty In output my gridview code: < EmptyDataTemplate > No Records Found ! ! ! < / EmptyDataTemplate > < Columns > < asp : TemplateField HeaderText = "originStationId"> < ItemTemplate > < asp : Label ID Error, EventArgs, ASP.NET, DataBind, Click, Null description: API Null Error in this API staging.ticketgoose.com / bookbustickets / services / TGSWSwsdl i am getting null error in getstationlist I add web reference
12 07:32 PM How to write code to bring output like this: http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl table name is getTripListV2 i have written code is error. . . it is webservice. . . protected void Button1_Click( object sender, EventArgs e) { TGTravelServiceService ts = new TGTravelServiceService (); var data = ts.getTripDetailsV2( "userid" , "pwd" , "71" , "72" , "10 / 06 / 2012" , "OSB8R843444" ); GridView1.DataSource = data Here is the code part: protected void btnGetStationList_Click( object sender, EventArgs e) { / / Get station list TGTravelServiceService ts = new TGTravelServiceService(); / / var data = ts.getFromToStationIdList("vs00saini@gmail.com", "saini2186"); / / var data = ts.getFromToStationIdList("maddyrafi@gmail.com 2012" , "OSB8R843444" ); / / var data = ts.getStationList("maddyrafi@gmail.com", "samerafi"); / / Get station list displayed in gridview if (data.tripDetails ! = null ) { grdStation.DataSource = data.tripDetails; grdStation.DataBind(); } else { lblInfo.Text = "Received null is not returning any value. And in your code you need to do following changes- TGTravelServiceService ts = new TGTravelServiceService (); var data = ts.getTripDetailsV2( "userid" , "pwd" , "71" , "72" , "10 / 06 / 2012" , "OSB8R843444
write this code ASP.NET 28-Oct-12 07:31 PM How to write this ? TGTravelServiceService ts = new TGTravelServiceService (); / / here code ? GridView1.DataSource = data; GridView1.DataBind(); } in this link http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl how to get getStationList and how to add that in my code ? Hello, Pass your user name and password to get Station list TGTravelServiceService ts = new TGTravelServiceService (); ts.getStationList( "rb_devloper_it@yahoo.co.in" , "test" ); After then check which value display in ts data then you convert this XML data to Datatable And then bind this datatable to gridview Hope this helpful! Thanks TGTravelServiceService ts = new TGTravelServiceService (); var data = ts.getStationList( "maddyrafi@gmail.com" , "samerafi" ); GridView1.DataSource = data.stationList
07:31 PM 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 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 Click description: Webservice Error First i add webreference in my project the url is staging.ticketgoose.com / bookbustickets / services / TGSWSwsdl and namespace is using com.t
07:31 PM 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 (); var data = ts.getStationList( "maddyrafi@gmail.com" , "samerafi" ); GridView1.DataSource = data; GridView1.DataBind(); } Error: Data an IListSource, IEnumerable, or IDataSource. This error comes due to wrong datasoure when you bind gridview than that should return list of collection so you must convert to list In your so you should convert it explicitly as follows protected void Button1_Click( object sender, EventArgs e) { TGTravelServiceService ts = new TGTravelServiceService (); var data = ts.getStationList( "maddyrafi@gmail.com" , "samerafi" ); GridView1.DataSource = data. ToList (); GridView1.DataBind(); } hope IDataSource, DataBind description: Error First i add webreference in my project the url is staging.ticketgoose.com / bookbustickets / services / TGSWSwsdl and namespace is using com.ticketgoose.
goto this website http: / / staging.ticketgoose.com / in rightside select from: chennai and to:madurai and select date and give search. . . it this work in my project using webservice this is the API of that http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl now i want to know. . . . in that search result it has search the result from this table getTripListV2 in that API, and my code was this: TGTravelServiceService ts = new TGTravelServiceService(); var data = ts.getTripListV2("userid", "pwd", DropDownList1.SelectedItem.Value, DropDownList2.SelectedItem.Value, txtdate.Text); GridView1 that person must be Technical. code Use getTripListWithAvailableSeats funciton for get Available seat. Your code TGTravelServiceService ts = new TGTravelServiceService (); var data = ts.getTripListWithAvailableSeats( "userid" , "pwd" , DropDownList1.SelectedItem.Value, DropDownList2.SelectedItem.Value, txtdate.Text); GridView1
Oct-12 07:32 PM How to write this in button Response.Redirect( http: / / www.ticketgoose.com ); search page i want to go. . . in my page i have 3 textbox in first destination and 3rd date i choose and give search means i want to display www.ticketgoose.com in this website it has the result that result i want to bring in my store return result in ona var variable , finally formulate the result based on your need. TGTravelServiceService ts = new TGTravelServiceService(); var data = ts.getTripList("maddyrafi@gmail.com", "samerafi", "72", "71", "21 / 05 / 2012"); var dataStation but i done the data fetch from that website. . . . if i enter means that page gridview want to come here. . . in my page i have 3 textbox in first textbox source 3rd date i choose and give search means i want to display like this . . . goto ticketgoose.com and search this above shown that result full page that want To show in
Image ASP.NET 28-Oct-12 07:32 PM This is my API http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl This is input: wsdl:message name = " getTripDetailsV2Request " > < wsdl:part name = " userId name = " scheduleId " type = " soapenc:string " / > < / wsdl:message > This is output: < complexType name = " TripDetailsDTO " > http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl# < sequence > < element name = " boardingPointList " nillable = " true " type = " impl:ArrayOf_tns2_BoardingPointDTO " / > < element name element name = " seatDetailList " nillable = " true " type = " impl:ArrayOf_tns2_SeatDetailDTO " / > < / sequence > < / complexType > < complexType name = " BusLayoutDTO " > http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl# < sequence > < element name = " level " type = " xsd:int " / > < element name = " nbrOfColumns " type type = " impl:ArrayOf_tns2_SeatDetailsDTO " / > < / sequence > Here how to write this coding for bus seat Layout: BusLayout: TGTravelServiceService ts = new TGTravelServiceService (); / / i have add this webservice here. . . var data = ts.getTripDetailsV2( "userid" , "pwd" , "72" , "71" , "25
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" ); } } Hello, Try to below step to use staging.ticketgoose.com / site web service. Note : first you need to register with this site. Then use this Step1 : Right Click on application and select Add Web References Step2 : After then http: / / staging.ticketgoose.com / bookbustickets / services / TGSWS?wsdl url and click on GO Step3: After then you whole webserive name you have set in previous step) Step5: After then use this webserice followig way TGTravelServiceService ts = new TGTravelServiceService (); ts.getStationList( "rb_devloper_it@yahoo.co.in" , "test" ); when you type ts and . this you get