|
Hello
I have a strange problem with the configuration of an application written in c # winform.
I wrote a simple application that reads some records from a table in sql remote. in the App.config file I wrote the connection string and everything works.
I copied the bin folder on another pc and for error I renamed the configuration file <apptext> .exe.config in <apptext> .exe.conig
I run the application and the application rightly gave me error because it could not find the config file. I renamed the file correctly and everything works fine.
What happens: :mad:
randomly when I do a restart of the PC, I find myself in the bin folder
the configuration file wrong, what I had written the first time <apptext> .exe.conig
Can anyone tell me how to solve this problem?
thank you
|
|
|
|
|
First you have to find out why it is getting renamed in that way, and there could be many reasons. Without access to your pc it is not possible to guess.
|
|
|
|
|
thansk for reply
is a week that I'm trying to understand what happens
by the time I solved by copying the configuration file at to the start of the application
but it's not good
the operating system is windows 7 and I just can not understand on what happens.
perhaps the first time, it was put configurator wrong in some cache
and when restart the PC overwrites the existing one.
I also removed the write permission to all users, including Administrator and System,
the problem remains
|
|
|
|
|
I can only assume that you are running this in Visual studio and regenerating the file when you restart your PC. Check all the settings in Visual Studio to see that it does not have a reference to the "wrong" name.
|
|
|
|
|
Hi Richard
thanks again for replay
No, the application is not launched from Visual Studio
I wrote, compiled and put on a pc
And i checked into reference but nothing
the strange thing is that it reappears old configurator
even now he did .....................
I'm going crazy
thanks
|
|
|
|
|
Sorry, but there is nothing we can suggest without a lot more information.
|
|
|
|
|
Thanks for your time
I solved the problem
|
|
|
|
|
hi does anyone know how i can disable the animation which happens to a windows form when the this.hide() is used?
i am trying to do this without using thread.sleep.
i am using vs.net 2012. thanks and any help is appreciated.
|
|
|
|
|
neodeaths wrote: hi does anyone know how i can disable the animation which happens to a windows
form when the this.hide() is used? I haven't tried it, but I guess it'd be the performance options of Windows. There's a setting in the system-page somewhere that let's the user decide between "cool" (animations, shades and stuff) and "fast" (no animation, no shades). Or to let Windows decide. AFAIK, it's a settting that would change the behaviour for ALL applications.
neodeaths wrote: i am trying to do this without using thread.sleep. Try clearing the .Controls collection and making the form 100% transparent. "Hide" it after that.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Maybe this help:
enum DWMWINDOWATTRIBUTE : uint
{
NCRenderingEnabled = 1,
NCRenderingPolicy,
TransitionsForceDisabled,
AllowNCPaint,
CaptionButtonBounds,
NonClientRtlLayout,
ForceIconicRepresentation,
Flip3DPolicy,
ExtendedFrameBounds,
HasIconicBitmap,
DisallowPeek,
ExceludedFromPeek,
Cloak,
Cloaked,
FreezeRepresentation
}
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE attr, ref int attrValue, int attrSize);
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
if (Environment.OSVersion.Version.Major >= 6)
{
int attrValue = 1;
int hr = DwmSetWindowAttribute(this.Handle, DWMWINDOWATTRIBUTE.TransitionsForceDisabled, ref attrValue, 4);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
}
}
|
|
|
|
|
Hello All,
It has been some time since I have been here. I am currently stumped and think this should be easy.
I have a C# windows form with a pretty generic datagrid displaying the contents of 1 table.
I can update/add & delete data in the grid no problem.
My issue is I have a password field field in the table that is hidden.
I've added a text box and an update pwbutton.
How do I use the existing tableadapter/bindingsource to update a single field hidden in the dg?
(Never mind, figured it out.)
Is there a simple way to update my pw field?
Thanks for any ideas.
modified 30-Jul-14 15:18pm.
|
|
|
|
|
I need to develop a generic XMLEditor Form for an application (Windows Forms .Net 4.0).
The main concepts are:
- xsd definitions are known and stored as a resource
- form receives xml content string and the xsd name
- user must be able to edit (and add/delete) all of the xml attributes / values
Below is a sample of one of the xml content strings
<TechnicalCatalogInfo>
<Properties>
<Property id="1319" name="Some name"><![CDATA[</Property>
<Property id="2715" name="Other name"><![CDATA[</Property>
<Property id="2716" name="Another name"><![CDATA[</Property>
</Properties>
</TechnicalCatalogInfo>
There are 3 or 4 different xml schemas and this form must be able to edit all of them.
Do you think that this can be done?
|
|
|
|
|
Miguel Figueiredo wrote: Do you think that this can be done? Yup.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am creating setup file with sql server database but i am facing an error...network elated error and i can't get the data from .mdf.deploy file...plz help me...it's my first project on windows based...
|
|
|
|
|
Did you install SQL Server on the machine where you deployed the mdf file?
If not, install it. Then check your connectionstring - it should point to the PC that has SQL Server installed, and it needs to use the correct credentials.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello,
I need sample code for text mode printing in malayalam font in windows forms authentication.please any one can help me in this regard.
Thanks
Thiru
|
|
|
|
|
Thirugnanam Nataraj wrote: malayalam font You mix up encoding and font . With modern .Net applications, you do not need to worry about non-ASCII-characters: .Net uses Unicode, and Malayalam is well defined there.
Probably, you are used to some encodings of the ISCII standards. Those ISCII encodings are 8bit encodings, and the text files written with such an encoding do not have the byte marks required to automatically find out the encoding. Consequently, when you show it in a text editor with the wrong "font" selected, it may look like Hindi/Devanagari or totally garbage. But by selecting the "font" of your text editor, you actually selected the encoding.
So just type your Malayalam text into the text boxes of your Windows forms application, it will work. Do not copy it from such an 8bit text file as described above!
|
|
|
|
|
Hi Bernhard,
Thanks for your response.
can you send me the sample code for how to print malayalam fonts in dos-mode printing in windows forms application.
it's very urgent need.
Looking forward your reply..
Thanks
Thirugnanam
|
|
|
|
|
Hi!I have event, which when clicked begin downloading data in datagridview.
I make so,but is wrong.Form2 must be in other thread.How make right?
private void downloadToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.Show();
string path = "test.xml";
DataSet ds = new DataSet();
ds.ReadXml(path);
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "table1";
frm.Close();
}
Sorry for my english and thanks for advance.
|
|
|
|
|
|
I'm developing a MDI WinForm App using C#. I have a parent window with a splitContainer. Panel2 of the split container is used to used to display child forms while Panel1 is used for controls of the parent window. Child1 loads with parent form . However I have placed a button in Child1 that has to call child2 but I can't seem to find a way to close child1 and show child2 in panel2 of the Parent Split Container. I tried using the User Controls but I can't seem to pull through.. Please help.
|
|
|
|
|
I'm not sure I understand completely, but how about using that button to call a method in the parent that will close Child1 and replace it with Child2?
|
|
|
|
|
 Here are a few methods I use. Adapt as needed.
Public Function IsFormOpen(ByVal FormName As String) As Boolean
Dim rVal As Boolean = False
Dim frm As Form
For Each frm In Me.MdiChildren
If frm.Name = FormName Then
rVal = True
Exit For
End If
Next
Return rVal
End Function
Public Function ShowMdiChild(ByVal FormName As String) As Boolean
Dim rVal As Boolean = False
Dim frm As Form
For Each frm In Me.MdiChildren
If frm.Name = FormName Then
rVal = True
frm.Activate()
frm.WindowState = FormWindowState.Maximized
Exit For
End If
Next
Return rVal
End Function
Public Sub InvokeMdiChildMethod(ByVal MethodName As String)
Dim o As Object
o = Me.ActiveMdiChild
Try
o.GetType().GetMethod(MethodName).Invoke(o, Nothing)
Catch
End Try
End Sub
Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles NewToolStripMenuItem.Click, NewToolStripButton.Click, NewWindowToolStripMenuItem.Click
Dim ChildForm As New System.Windows.Forms.Form
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "Window " & m_ChildFormNumber
ChildForm.Show()
End Sub
|
|
|
|
|
Why have you posted this message to me?
|
|
|
|
|
I am working on windows application where the sensitive data in app.config file is encrypted i followed [^http://ozkary.blogspot.in/2013/03/encrypting-aspnet-application-settings.html] these to encrypt app.config file. It works very well in my machine. How do i deploy this?
|
|
|
|