|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
Hello coomunity!
I'm, once again, facing a little problem. I have a view that puts together different rows from 4 different tables. In my WinForm application I display those in a datagrid view, now I want to delete a row from the datagrid and remove the entry from the view aswell as from two of the tables 'linked' to it. How would I go about this? I've already tried looking for a solution online, though couldn't find anything that did what I need.
P.S. Kinda forgot to mention, that I'm using Entity Framework for the whole apllication.
|
|
|
|
|
|
I need to locate a multiline text in a pdf document. I found two possibilitis
ColumnText.ShowTextAligned(writer.DirectContent, Element.ALIGN_LEFT, new Phrase(textPhrase), calculatedX,calculatedY, -rotation);
But when I locate the text this way, I just can see the first line and all other lines get cutted.
TextField tf = new TextField(writer,
new Rectangle(calculatedX, calculatedY, calculatedX + width, calculatedY + height), "");
tf.Text = text;
tf.FontSize = font.Size;
tf.Font = font.BaseFont;
tf.Options = BaseField.MULTILINE | BaseField.READ_ONLY;
tf.TextColor = font.Color;
writer.AddAnnotation(tf.GetTextField());
This works good and I can see all lines but the problem is that i can not set attributes like Bold underline....
Can you please help me to find a way, that I can see all lines and set attributes like bold, underline...
|
|
|
|
|
Describe the tools/libraries you are using to parse/access the pdf file. Describe your development environment.
We cannot read your mind.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
Hi
I'm having a source code of an Api, but since we don't have to change it. I'm creating a windows service that register it as a COM component then it could be used from the client. I'll try to simplify my issue.
I started with the creation of an interface having the function and an event (that uses delegate)
[Guid(ApiServices.InterfaceId), ComVisible(true)]
public interface IApiServices
{
[DispId(1)]
ApiResult Function1();
[DispId(2)]
event TestEvent event1;
}
Then I created a class that implements this inteface
[
Guid(ClassId), ComVisible(true)
ClassInterface(ClassInterfaceType.None)
ProgId("ApiService")
]
public class ImplApiServices : MarshalByRefObject, IApiServices
{
private ApiObject _apiObject;
public ImplApiServices ()
{
_apiObject= new ApiObject();
_apiObject.TestEvent += OnEvent1;
}
ApiResult Function1()
{
return _apiObject.Function1();
}
public event TestEvent event1;
private void OnEvent1(object e)
{
if (event1 != null)
event1(e);
}
}
And then I did all the other steps to register it as a COM component and launch use it through a service.
when I call it using a client, it is recognized and the function returns the result perfectly
var _apiServiceObjType= Type.GetTypeFromProgID("ApiService");
var _apiServiceObj= Activator.CreateInstance(_apiServiceObjType);
var result = (ApiResult )_apiServiceObjType.InvokeMember("Function1",
BindingFlags.InvokeMethod, null, _apiServiceObj, null);
But when I want to subscribe a method to the event, I get a null eventInfo in the following instruction and can't go further
EventInfo eventInfo = _apiServiceObjType.GetEvent(event1);
Any link or recommendation that helps with this kind of problem is welcome.
Thanks
|
|
|
|
|
I believe you need to use the GetEvent() with "binding flags":
Quote: An event is considered public to reflection if it has at least one method or accessor that is public. Otherwise the event is considered private, and you must use BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static (in Visual Basic, combine the values using Or) to get it.
Type.GetEvent Method (String, BindingFlags) (System)
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi
Thanks for the answer.
I already tried that but it's not working 
|
|
|
|
|
I am a beginner in C #, I want to use the commands push and pull (adb) to transfer and synchronize a sqlite file to Sql server 2008 r2 to a windows forms application in C #. I need to transfer data from a mobile application to android, which contains a set of assessments on participants and then display the notes on the interface of the windows forms application. I need your help . Thank you
|
|
|
|
|
|
HI,
How can we get XML values into combo box any suggestions and also how we get URL open on clicking form load and get those values through xml to combobox.please suggest me some technics
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Please try to explain in better detail what the problem is, what you have tried to do to fix it, where you are stuck, and what help you need.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi,
From below xml file i need to get hospital names in combo box using c# , i have searched in net but i cant find the hint how can we read.
?xml version="1.0" encoding="utf-8" ?>
<hospitals>
<hids>
<hid>1</hid>
<hos_type>0</hos_type>
<hcode>SV</hcode>
<hname>St Vincents</hname>
<address>Australia</address >
<landline>56456456456</landline>
<mobile>569678768</mobile>
<email>bijibtrack1@gmail.com</email>
<status>0</status>
<created_by>fgdfgdfgdfg</created_by>
<created_on>2011-02-26 10:10:50</created_on>
<notes>dfgdfgdfg</notes>
<is_pms>0</is_pms>
<c_insert>1</c_insert>
<c_update>0</c_update>
<c_timezone></c_timezone>
</hids>
<hids>
<hid>2</hid>
<hos_type>0</hos_type>
<hcode>ARC</hcode>
<hname>ARC Clinic</hname>
<address>Australia.</address >
<landline>34563456</landline>
<mobile>34563456</mobile>
<email>bijibtrack1@gmail.com</email>
<status>1</status>
<created_by></created_by>
<created_on>2012-10-10 00:00:00</created_on>
<notes>australia</notes>
<is_pms>0</is_pms>
<c_insert>1</c_insert>
<c_update>0</c_update>
<c_timezone>2011-02-11 18:27:09</c_timezone>
</hids>
|
|
|
|
|
|
yes, i am trying to read data from xml to display in combo box but i am unable to get exact solution..
|
|
|
|
|
So what code did you try, and what did it do that your didn't expect, or not do that you did?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have tried below code but i am not getting the values in combobox
void MainFormLoad(object sender, EventArgs e)
{
string myXmlfile=@"C:\Users\anusha\Documents\SharpDevelop Projects\hospitals.xml";
DataSet ds= new DataSet();
System.IO.FileStream fsReadXml= new System.IO.FileStream
(myXmlfile,System.IO.FileMode.Open);
ds.ReadXml(fsReadXml);
cmbHospitals.DataSource=ds;
cmbHospitals.DisplayMember="name";
}
<pre lang="c#">
|
|
|
|
|
Well, a very quick debugging session and some light thinking would have told you several things:
1) Your XML is missing the opening < and will not process as a result.
2) Your XML is missing the closing tag: </hospitals>
3) You code expects the ComboBox to work out for itself which table to use: don't pass the dataset as the DataSource, pass the table. DataSets can contain multiple tables.
4) There is no "name" data in your XML file. There is "hname" data though...
5) You shouldn't hold the file open: add a using block round the FileStream creator.
DataSet ds = new DataSet();
using (System.IO.FileStream fsReadXml = new System.IO.FileStream(myXmlfile, System.IO.FileMode.Open))
{
ds.ReadXml(fsReadXml);
}
cmbHospitals.DataSource = ds.Tables[0];
cmbHospitals.DisplayMember = "hname";
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks sir for clarifying, I have given the correct coding.I have written below code for displaying hospital names but i am unable to display names.
void MainFormLoad(object sender, EventArgs e)
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load("hospitals.xml");
XmlNodeList hospitals = xDoc.GetElementsByTagName("hospitals");
for (int i = 0; i < hospitals.Count; i++)
{
cmbHospitals.Items.Add(hospitals[i].Attributes["hname"].InnerText);
}
}
|
|
|
|
|
Did you read the code I gave you, at all?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
yes , i have gone through it,but i am trying to get values into combobox, i am totally confused of what i am doing.and what the helpers are trying to guide
|
|
|
|
|
Just copy the code from my post, and paste it into your app. Run your code, and (provided you've fixed the other problems) it should load the hospital names into the combobox.
It did for me when I tested it against your (corrected) data!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks you sir.. I got the required output
|
|
|
|
|
You're welcome!
Do you understand why?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|