Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
GeneralRe: word 2007 template application Pin
padmanabhan N12-Aug-09 0:47
padmanabhan N12-Aug-09 0:47 
QuestionHow was use namedpipes to communicate with other application in a network? Pin
svt gdwl11-Aug-09 23:46
svt gdwl11-Aug-09 23:46 
AnswerRe: How was use namedpipes to communicate with other application in a network? Pin
stancrm12-Aug-09 0:10
stancrm12-Aug-09 0:10 
GeneralRe: How was use namedpipes to communicate with other application in a network? Pin
svt gdwl12-Aug-09 0:50
svt gdwl12-Aug-09 0:50 
GeneralRe: How was use namedpipes to communicate with other application in a network? Pin
stancrm12-Aug-09 0:54
stancrm12-Aug-09 0:54 
Questionaccessing controls of one form in another form Pin
MahaKh11-Aug-09 22:56
MahaKh11-Aug-09 22:56 
AnswerRe: accessing controls of one form in another form [modified] Pin
OriginalGriff11-Aug-09 23:41
mveOriginalGriff11-Aug-09 23:41 
QuestionApplication definition was successfully imported, but Entity X has no identifiers defined in the SpecificFinder view Pin
hdv21211-Aug-09 22:38
hdv21211-Aug-09 22:38 
Hi i created a web service with two method that will be call via sharepoint bdc. my problem is that adf file was successfully imported but it has a warning :

Application definition was successfully imported. 1 warning(s) found. Consider fixing the warnings and updating the application definition.
Warning :
Could not create profile page for Entity News. The error is: Profile page creation for the Entity News skipped. Entity News has no identifiers defined in the SpecificFinder view


Here is my web service :

[WebMethod]
    public List<News> GetNews()
    {
        List<News> list = new List<News>();
        using (MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySqlConnectionString"].ConnectionString))
        {
            using (MySqlCommand cmd = con.CreateCommand())
            {
                cmd.CommandText = "select id,title,introText,created from jos_content order by created desc,id desc";

                if (con.State != System.Data.ConnectionState.Open)
                    con.Open();

                MySqlDataReader dr = cmd.ExecuteReader();

                while(dr.Read())
                {
                    list.Add(new News(dr.GetInt32(0), dr.GetString(1), dr.GetString(2), dr.GetString(3)));
                }

                dr.Close();
                if (con.State != System.Data.ConnectionState.Closed)
                    con.Close();
            }
        }
        return list;
    }

    [WebMethod]
    public List<News> GetNewsByID(int id)
    {
        List<News> list = new List<News>();
        using (MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySqlConnectionString"].ConnectionString))
        {
            using (MySqlCommand cmd = con.CreateCommand())
            {
                cmd.CommandText = "select id,title,introText,created from jos_content where id=@id order by created desc,id desc";
                cmd.Parameters.Add(new MySqlParameter("@id", id));

                if (con.State != System.Data.ConnectionState.Open)
                    con.Open();

                MySqlDataReader dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    list.Add(new News(dr.GetInt32(0), dr.GetString(1), dr.GetString(2), dr.GetString(3)));
                }

                dr.Close();
                if (con.State != System.Data.ConnectionState.Closed)
                    con.Close();
            }
        }
        return list;
    }


here is my News class :

public class News
{
    int _newsID;
    string _newsTitle;
    string _newsBody;
    string _dateCreated;

    public string DateCreated
    {
        get { return _dateCreated; }
        set { _dateCreated = value; }
    }

    public int NewsID
    {
        get { return _newsID; }
        set { _newsID = value; }
    }

    public string NewsTitle
    {
        get { return _newsTitle; }
        set { _newsTitle = value; }
    }

    public string NewsBody
    {
        get { return _newsBody; }
        set { _newsBody = value; }
    }

	public News()
	{
		
	}

    public News(int id, string title, string body, string dateCreated)
    {
        this.NewsID = id;
        this.NewsTitle = title;
        this.NewsBody = body;
        this._dateCreated = dateCreated;
    }
}


here is my adf file :

<LobSystemInstances>
    <LobSystemInstance Name="ServiceInstance">
      <Properties>
        <Property Name="LobSystemName" Type="System.String">Service</Property>
      </Properties>
    </LobSystemInstance>
  </LobSystemInstances>
  
  <Entities>
    <Entity Name="News">
      <Properties>
        <Property Name="NewsTitle" Type="System.String">NewsTitle</Property>
      </Properties>
      <Identifiers>
        <Identifier Name="NewsID" TypeName="System.Int32"></Identifier>
      </Identifiers>
      <Methods>
        <Method Name="GetNews">
          <Parameters>
            <Parameter Direction="Return" Name="GetNewsResults">
              <TypeDescriptor TypeName="ServiceProxy.News[],Service" IsCollection="true" Name="ArrayOfNews">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="ServiceProxy.News,Service" Name="News">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="System.Int32" IdentifierName="NewsID" Name="NewsID" />
                      <TypeDescriptor TypeName="System.String" Name="NewsTitle" />
                      <TypeDescriptor TypeName="System.String" Name="NewsBody" />
                      <TypeDescriptor TypeName="System.String" Name="DateCreated" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Name="FinderGetNewsResultsInstance" Type="Finder" ReturnParameterName="GetNewsResults" ReturnTypeDescriptorName="ArrayOfNews" ReturnTypeDescriptorLevel="0" />
          </MethodInstances>
        </Method>

        <Method Name="GetNewsByID">
          <FilterDescriptors>
            <FilterDescriptor Type="Comparison" Name="NewsID" />
          </FilterDescriptors>
          <Parameters>
            <Parameter Direction="In" Name="NewsID">
              <TypeDescriptor TypeName="System.Int32" Name="NewsID" AssociatedFilter="NewsID" IdentifierName="NewsID" />             
            </Parameter>            
            <Parameter Direction="Return" Name="GetNewsByIDResults">
              <TypeDescriptor TypeName="ServiceProxy.News[],Service" IsCollection="true" Name="ArrayOfNews">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="ServiceProxy.News,Service" Name="News" IdentifierName="NewsID">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="System.Int32" Name="NewsID" />
                      <TypeDescriptor TypeName="System.String" Name="NewsTitle" />
                      <TypeDescriptor TypeName="System.String" Name="NewsBody" />
                      <TypeDescriptor TypeName="System.String" Name="DateCreated" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Name="SpecificFinderGetNewsByIDResultsInstance" Type="SpecificFinder" ReturnParameterName="GetNewsByIDResults" ReturnTypeDescriptorName="ArrayOfNews" ReturnTypeDescriptorLevel="0" />
          </MethodInstances>
        </Method>
        
      </Methods>
    </Entity>
  </Entities>


where is my problem and how to solve it ?
thanks
QuestionHow to convert .MPP File to .XML File in C# Pin
Rajesh_K_Sharma11-Aug-09 22:27
Rajesh_K_Sharma11-Aug-09 22:27 
AnswerRe: How to convert .MPP File to .XML File in C# Pin
Alenzo_Eid10-Mar-10 0:45
Alenzo_Eid10-Mar-10 0:45 
QuestionHow to Split one datatable to many datatables? Pin
NguyenDzung11-Aug-09 21:58
NguyenDzung11-Aug-09 21:58 
AnswerRe: How to Split one datatable to many datatables? Pin
dan!sh 11-Aug-09 22:14
professional dan!sh 11-Aug-09 22:14 
AnswerRe: How to Split one datatable to many datatables? PinPopular
Pete O'Hanlon11-Aug-09 22:36
mvePete O'Hanlon11-Aug-09 22:36 
GeneralRe: How to Split one datatable to many datatables? Pin
NguyenDzung12-Aug-09 17:40
NguyenDzung12-Aug-09 17:40 
GeneralRe: How to Split one datatable to many datatables? Pin
Prince Antony G5-Jan-12 22:32
Prince Antony G5-Jan-12 22:32 
QuestionGet what object a button belongs to? Pin
xkrja11-Aug-09 21:54
xkrja11-Aug-09 21:54 
AnswerRe: Get what object a button belongs to? Pin
Pete O'Hanlon11-Aug-09 21:58
mvePete O'Hanlon11-Aug-09 21:58 
GeneralRe: Get what object a button belongs to? Pin
xkrja11-Aug-09 22:09
xkrja11-Aug-09 22:09 
AnswerRe: Get what object a button belongs to? Pin
stancrm11-Aug-09 22:07
stancrm11-Aug-09 22:07 
GeneralRe: Get what object a button belongs to? Pin
xkrja11-Aug-09 22:19
xkrja11-Aug-09 22:19 
AnswerRe: Get what object a button belongs to? Pin
Luc Pattyn11-Aug-09 23:59
sitebuilderLuc Pattyn11-Aug-09 23:59 
AnswerRe: Get what object a button belongs to? Pin
Daniel Grunwald12-Aug-09 2:53
Daniel Grunwald12-Aug-09 2:53 
Questiontext box multiline Pin
Vivek Vijayan11-Aug-09 21:37
Vivek Vijayan11-Aug-09 21:37 
AnswerRe: text box multiline Pin
stancrm11-Aug-09 21:44
stancrm11-Aug-09 21:44 
AnswerRe: text box multiline Pin
Ashfield11-Aug-09 21:44
Ashfield11-Aug-09 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.