|
hi
i have 3 tables : t_books,t_sessions,t_titles that has master/details relation together :
t_books(bookID(PK),bookName) -> master
t_sessions(sessionID(PK),bookID(FK),sessionName) -> details
t_sessions(sessionID(PK),bookID(FK),sessionName) -> master
t_titles(titleID(pk),sessionID(fk),titleName,text,footerPage) -> details
when i search in these 3 tables, and create relation for these tables, the following error has shown me when i add dataRelation to my dataset :
These columns don't currently have unique values
my request is : how to search in 3 tables with relational data and show the result in treeView ?
thanks
|
|
|
|
|
I'm attempting to write a file to a removable drive. When the app gets to the point where it creates the StreamWriter, it's stops and tells me access to the *whatever*:\ drive denied. I have administrator rights, and have also given the app admin rights by "running as admin". Is there something I should be doing besides the usual to get this working? Is what I'm doing correct?
private void button1_Click(object sender, EventArgs e)
{
string usbDriveLetter = listBox1.SelectedItem.ToString();
string sPath = usbDriveLetter;
sPath = usbDriveLetter.ToString();
StreamWriter sw = new StreamWriter(sPath);
...and so on
Thank you for your input.
|
|
|
|
|
check!!may be your flash drive is write protected
|
|
|
|
|
Nope. Not write protected. I'm wondering, in the code I'm opening StreamWriter, but not actually writing anything yet. Could this be the problem?
|
|
|
|
|
I think proplem is occuring because you are not providing any file name
try to write like this
string sPath = usbDriveLetter;<br />
sPath = usbDriveLetter.ToString()+"\\myFile.txt";<br />
StreamWriter sw = new StreamWriter(sPath);
|
|
|
|
|
HEllo,
I don't think that a drive letter is a correct path argument for the StreamWriter Constructor.
You should use a path to a file!
All the best,
Martin
|
|
|
|
|
Even if the file doesn't exist yet? If that's the problem, boy do I feel like an idiot.
|
|
|
|
|
simplicitylabs wrote: Even if the file doesn't exist yet?
Yes
simplicitylabs wrote: If that's the problem, boy do I feel like an idiot
You shouldn't. But MSDN is your friend at this kind of proplems: http://msdn2.microsoft.com/en-us/library/36b035cb.aspx[^]
All the best,
Martin
|
|
|
|
|
After lots of research I still cant find an effective way of inheriting windows forms from my custom window forms.
In Vis Studio 2005 in C#
I have a dll project MyWinFormProject which includes a customised winform "MyWinForm" and builds into MyWinFormProject.dll.
I have a seperate standard C# windows app project WindowsApplication1.
When in WindowsApplication1 I add a new inheriited form Form1 which I want to inherit from MyWinForm.
I have been trying 2 ways of doing this:
1. 'Export Template', MyWinForm from MyWinFormProject which creates a zip file. Then go through the Add Item Dialog,
but this then exposes all confidential source code of MyWinForm in Form1, which is unsuitable.
2. Go through the Add Item Dialog -> Inheritance Dialog and browse to MyWinFormProject.dll and add this as a reference and inherit
from MyWinForm in the componet list. This adds MyWinFormProject.dll to the WindowsApplication1 project bin folder. This approach works
fine until I try to add a second winform Form2 inherited from MyWinForm, then I get the error message "Uanble to Add reference......Check a different version of 'MyWinFormProject' is not already referenced.
Many thanks
Steven Spencer.
|
|
|
|
|
Hello,
To 2.
Look at the references.
Is there a second referenc to your dll?
If yes you can delete it manually and try to compile again.
All the best,
Martin
|
|
|
|
|
Hi,
I have one class file that is stored in one of the subfolders in the Application. I need to load a class file dynamically and get the details (Properties and Fields) of the class.
(i.e.) Employee.cs file is stored inside one of the subfolder.
Using programatically at runtime i need to load that class file and read the information about that class file using Reflection.
Is it possible to do this? If so in what way can i do? Can anyone pls reply me? I am in urgent need..
Expecting your reply..
Thankfully,
jm
|
|
|
|
|
Are you loading source code file or the assembly file? If it is assembly than you can use reflection. As for source file you can compile it dynamically during runtime and then use the above method. I don't know if there is any other way with source file
|
|
|
|
|
I am loading the source file not the assembly file. In this case how can i get the class properties and fields??
Thankfully,
jm
|
|
|
|
|
In that case as I have said you can compile it during runtime dynamically and then use reflection. I can't think of any other way.
|
|
|
|
|
As Giorgio said, you can compile the source and use reflection to inspect it. I'm not sure that's the solution that you really need, though. What is it that you are trying to accomplish, really?
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
Why i am in need of this is i need to generate an XML by reading the properties from a Class file (in any language C#, VB.Net..etc).. for that i have to know the properties defined in those class files and based on the properties and datatype of those properties i need to generate a dynamic XML files
example
If a class file is something as
public Class A<br />
{<br />
private int number;<br />
private string name;<br />
<br />
public int Number<br />
{<br />
get {return number;}<br />
set {number = value;}<br />
}<br />
<br />
public string Name<br />
{<br />
get {return name;}<br />
set {name = value;}<br />
}<br />
}
based the above shown class, i have to generate by getting the properties of the class
<Bobject name="A"> <!-- "A" is class Name --><br />
<DataMember name="Number"> </DataMember> <!-- Member 1 --><br />
<DataMember name="Name"> </DataMemebr> <!-- Member 2 --><br />
</Bobject>
Like this i have to generate XML file.. For this i need to get the reflection of class, isnt it? Is any other way available to get the properties declared in a class file?
Expecting your reply.
Thankfully,
jm
Thankfully,
jm
|
|
|
|
|
It really sounds like you are trying to reinvent the wheel... Visual Studio can create XML documentation when you compile the code. Just enable "XML Documentation" in the build options for the project.
If you want this for documentation, you can add xml comments in the code, which will be included in the xml file, from which you then can create complete documentation in several different formats usings Sandcastle. The xml files created are also used in intellisense, so when using the class you will see the comments about the members in the intellisense just as with the classes in the framework. Visual Studio even helps you create the comments; just type /// on the line before a member (''' in VB), and it will provide you with a template for the comments.
Example:
public string GetInfo(int index) {
return _someInfo[index];
}
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
Why i am in need of this is i need to generate an XML by reading the properties from a Class file (in any language C#, VB.Net..etc).. for that i have to know the properties defined in those class files and based on the properties and datatype of those properties i need to generate a dynamic XML files
example
If a class file is something as
<code>public Class A
{
private int number;
private string name;
public int Number
{
get {return number;}
set {number = value;}
}
public string Name
{
get {return name;}
set {name = value;}
}
}</code>
based the above shown class, i have to generate by getting the properties of the class
<Bobject name="A">
<DataMember name="Number"> </DataMember>
<DataMember name="Name"> </DataMember>
</Bobject>
Like this i have to generate XML file.. For this i need to get the reflection of class, isnt it? Is any other way available to get the properties declared in a class file?
Expecting your reply.
Thankfully,
jm
Thankfully,
jm
Thankfully,
jm
|
|
|
|
|
I think you may have a conceptual problem. The assembly loads the class whenever you have an instance of the class or call into the class. At that time, you can reflect the class; but if you wrote the class you should be able to indicate anything about it by even more straightforward processes.
Nonetheless, you don't load the file to reflect on the object: You reflect (usually) an instance of the object or a type object representing the class.
|
|
|
|
|
hello,
i have an MDI form that called FORM1
an I have a child form FORM2
I wrote:
form2.MDIPerent = form1
it works but in the side i get scroll bars
how I get over the scroll bars?
P.S
I try to use autoscroll = true
but it can't be done on an MDI FORM
|
|
|
|
|
you must use this code
Form2 frm = new Form2();
frm.MDIParrent = this;
frm.Show();;)
note: Your MDI Form must larger than child Form.
|
|
|
|
|
hi all,
I have a datagridview which when I populate it with data, the first row is selected by default.
IIRC in .Net 1.1 the DataGrid never used to do this.
Any one know how I can stop it?
I've tried setting every row's Selected property to false.
Thanks
|
|
|
|
|
First Check whether u have write any code in the Rowbound. If not please check whether selectedIndex prrperty is set to -1. I hope this will solve ur problem
Regards,
A Jabeer Ali
|
|
|
|
|
there isn't a selectedIndex property and I haven't hooked any events as of yet.
|
|
|
|
|
Sorry My friend. This Option is available in net.2005 for ASP:gridview.
what version u r using?
Regards,
A Jabeer Ali
|
|
|
|