|
If the relations are simple (and a small number), then it's better doing things "by hand", and keep the database separated:
1. Create triggers to enforce what would be foreign keys, and to keep data in sync.
2. Create views to ease SELECTs.
Yes, even I am blogging now!
|
|
|
|
|
Hello
I want to check whether the given file is opened by other application such as notepad,paint,word,etc.
How can I do this in C#?
I tried using CFileStatus class. But did not get the exact info.
Can I use WMI?
|
|
|
|
|
It's not feasible.
You'll face lots of problems, like Word, which will load the file and lock it (or part of it), so if you try to open the file for exclusive access, it'll fail and you know it has been loaded by someone - you just won't know who.
Some programs like notepad, load the file to RAM and don't lock it, so it's even undetectable.
Yes, even I am blogging now!
|
|
|
|
|
hi all readers,
i want to display the image/bitmap or precisely an icon file in the text box or rich text box using C#. how can it be possibly? plz do reply if any one know this.
|
|
|
|
|
The simplest method is using clipborad.
Other method is converting the image into Windows Meta File (Wmf) and preparting the rtf and finally assigning the rtf to the richTextBox.
The first's solution is as below:
string fileName = string.Empty;
if(System.IO.File.Exists(fileName))
{
System.Drawing.Image myImg = System.Drawing.Image.FromFile(fileName);
Clipboard.SetDataObject(myImg, fale);
DataFormats.Format myFormat = DataFormats.GetFormat (DataFormats.Bitmap);
if(this.richTextBox1.CanPaste(myFormat))
{
this.richTextBox1.Paste();
}
}
Regards,
Jay
|
|
|
|
|
To add to what Jay said, the TextBox control doesn't support adding graphics. You must use a RichTextBox or create your own TextBox control.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Im doing this backpropogation network and so far, i think i would've done it faster and with less lines of code in c++. i don't know still getting used to .net :b
IM PROUD TO BE A GMAIL;
|
|
|
|
|
tom_dx wrote:
i think i would've done it faster and with less lines of code in c++.
Probably that means you still need to learn C# Although C++ wins in terms of container and algorithm support, C# has a lot going for it. you just need time to find it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
ya, i don't know, i tried doing friend neuron and saw that there isn't even a friend keyword; so basically im doing this in functions... which i think would make more sense in oop terms than just plain functions..
IM PROUD TO BE A GMAIL;
|
|
|
|
|
The absence of friend classes is one thing that really sucks in C#.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I agree. There is internal modifier, which *sometimes can* help. Bt yes, C# sux in there.
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
check out
Object-Oriented Programming in C#[^]
You can use the internal keyword and have both classes in an assembly, nothing outside the assembly can access the internal method.
Gary
|
|
|
|
|
i hate programming in C#!!!!!!
|
|
|
|
|
go to assembler, duh!!
next question
IM PROUD TO BE A GMAIL;
|
|
|
|
|
try VB.NET. Then you'll feel better, or worse. If worse, then you're too dumb for C#.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Then either make an appointment to go see your therapist, or ask us a question we can actually help you with.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello all,
How do I update combo box items bound to a data source? Say I have several combo boxes used for customer address fields. I have a combo box for states and cities. When I select a state, second combo box should display all cities in selected state. It works fine when I do state selection at the first time, all cities are selected from the table shown in the "city" combo box. When I try to select another state, the "city" combobox doesn't get refreshed. Is there anything I have to do to force combobox to refill its contents from the datasource and how do I do that?
Thanks in advances.
|
|
|
|
|
How do u obtain the system information to program a browse button?
|
|
|
|
|
what are you talking about, a button to return the value of a user specified file or folder?? take a look at openfiledialog control or folderbrowserdialog control
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Hi,
I am trying to solve a problem using C#. Basically it invovles capturing any application in the form of image. lets say the active application is acrobat reader, My application has to capture the image of the window of it and send it across the network.
Networking part is very easy in C# but capturing the image of other applications i could not find a way. Please tell me if i can do that with other lnaguages like c, C++.
eligeti
|
|
|
|
|
eligeti wrote:
Networking part is very easy in C# but capturing the image of other applications i could not find a way.
To capture an image of a visible window, you need to use GDI and BitBlt. IF the window is not visible, you can use WM_PRINT and/or WM_PRINTCLIENT.
Not exactly for newbies, but you can find a lot of samples on how to do this on Google.
Yes, even I am blogging now!
|
|
|
|
|
Hey I have created a Listview with labelEdit property set to true.
But for the label to become editable it requires atleast 2 clicks.
How can I make it editable on a single click ??
If i set the Activation property to single_click it cant be edited at all
|
|
|
|
|
On the click event, call:
SendMessage(yourListView.Handle, LVM_EDITLABEL, itemToEdit, 0);
and add the following declarations to your class:
[DllImport("User32.dll")]
public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam);
const int LVM_EDITLABEL = 4214;
Yes, even I am blogging now!
|
|
|
|
|
Hi
I have this code
<br />
string name = "tabPage0";
mainTabs.TabPages.Add(name);<br />
Then I would like some way to set tabPage0.Text How is this done?
Thanks
|
|
|
|
|
You could just write a function that will dynamically add new TabPage 's for you. Something like the following will do it for you, this assumes the TabControl is a member of the same class of this method. You could change this if you needed but this should get you started.
private void AddNewTabPage(string tabText)
{
TabPage tp = new TabPage(tabText);
this.TabControl.TabPages.Add(tp);
this.TabControl.SelectedTab = tp;
}
- Nick Parker My Blog | My Articles
|
|
|
|