Wednesday, December 17, 2014


 Service1.svc.cs


        public string CompanyintrestedStudentList(string companyname)
        {
            string data = "";
            DataSet ds = new DataSet();


            try
            {

                ds = SqlHelper.ExecuteDataset("Fetch_intrestedstudentlist", companyname);
                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                            {
                                for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
                                {
                                    data += (ds.Tables[0].Rows[i][j].ToString())+",";

                                }
                                data += ";";
                            }

                        }
                        else
                        {
                            return null;
                        }
                    }
                    else
                    {
                        return null;

                    }

                }
                else
                {
                    return null;

                }


            }
            catch (Exception ex)
            {
                ErrorLog.WriteError(ex.Message);
                //ErrorLog.WriteError(ex.Message + "Error Stack" + ex.StackTrace);
                //return null;
            }


            return data;

        }

 

 

 

No comments: