I have an application that runs very slowly when ran from the .exe
The Performance is 10 times better when i run it from within visual studio.
What could be the cause of this?
The Application itself parses through records in a binary file.
I have an application that runs very slowly when ran from the .exe
The Performance is 10 times better when i run it from within visual studio.
What could be the cause of this?
The Application itself parses through records in a binary file.
this code is not working
SqlConnection conn1 = (SqlConnection) ConnectionManager.Factory.BBADBConnectionFactory.GetGenericConnection<BBASQLLocalConnection>(ConnectionType.LocalSQLConnection);
rather throwing error like Cannot convert type 'ConnectionManager.SQLLocalConnection' to 'System.Data.SqlClient.SqlConnection
publicstatic T GetGenericConnection<T>(ConnectionTypeConnectionFor){if(ConnectionFor==ConnectionType.LocalSQLConnection)return(T)Convert.ChangeType((newSQLLocalConnection()).Connection,typeof(T));elseif(ConnectionFor==ConnectionType.ORCSWEBSQLConnection)return(T)Convert.ChangeType((newORCSSQLConnection()).Connection,typeof(T));elseif(ConnectionFor==ConnectionType.ReportConnection)return(T)Convert.ChangeType((newSQLReportConnection()).Connection,typeof(T));elsereturn(T)Convert.ChangeType((newSAGEConnection()).Connection,typeof(T));}
publicsealedclassSQLLocalConnection{SqlConnection sqlCon;publicSQLLocalConnection(){string connectionString =DBConnectionFactory.GetDBConnectionString<DBConnectionString>(DBCommon.SQLCredentialLocal).ToString();
sqlCon =newSqlConnection(connectionString);}publicSqlConnectionConnection{
get{return sqlCon;}}}
Hy friend,
I have a problem
I just create a form for playing sound, her's my code
public partial class Form1 : Formthe problem is the sounds always Looping, what I want is this sound just play once
and also I want to change the path of the sound (not always in C:\ directory)
Does anyone can help me ??
Thank You :)
Regards,
Steve Henry
Padma Yeddula
When I added if (System.IO.File.Exists(fileName)) to the method where SaveToFolder is called, the codes inside the method was totally skipped. I do not have to check System.IO.File.Exists(fileName) anyway.
private void SaveToFolder(Image img, string fileName, string extension, Size newSize, string pathToSave)
{
// Get new resolution
Size imgSize = NewImageSize(img.Size, newSize);
using (System.Drawing.Image newImg = new Bitmap(img, imgSize.Width, imgSize.Height))
{
using (MemoryStream MS = new MemoryStream())
{
newImg.Save(Server.MapPath(pathToSave), img.RawFormat); //A GENERIC ERROR OCCURS IN GDI+
}
}
}
public Size NewImageSize(Size imageSize, Size newSize)
{
Size finalSize;
double tempval;
if (imageSize.Height > newSize.Height || imageSize.Width > newSize.Width)
{
if (imageSize.Height > imageSize.Width)
tempval = newSize.Height / (imageSize.Height * 1.0);
else
tempval = newSize.Width / (imageSize.Width * 1.0);
finalSize = new Size((int)(tempval * imageSize.Width), (int)(tempval * imageSize.Height));
}
else
finalSize = imageSize; // image is already small size
return finalSize;
}
}
Dear All,
We have a Development Environment of Visual Studio 2013 on Windows 8.1 for Winforms Application development which connects to remote MS SQL Server databases.
All were going fine until we installed Visual Studio 2015 recently along with Visual Studio 2013.
After installing .NET Framework 4.6.1, we are having issue connecting to the remote SQL database as stated in the MSDN blog https://blogs.msdn.microsoft.com/dataaccesstechnologies/2016/05/07/connection-timeout-issue-with-net-framework-4-6-1-transparentnetworkipresolution/.
Now we are in a position where we are UNABLE to use the parameter TransparentNetworkIPResolution because the database connection to the database is happending through another 3rd party API which expects just the primary database details like data source and its credentials.
Is there any other way by which we can override or set the value of TransparentNetworkIPResolution to false in the development environment?
Thanks in advance and any help is highly appreciated.
WIth Warm Regards,
Sujan
Hi, New to this forum. If the above does not belong to this forum, please kindly move to the correct one. Thanks
I want to build a socket App.
For the server side :
1) what are the differences between SocketServer and StreamSocketListener?
2) I am using Visual Studio 2015 community version, which one should I use ? SocketServer or StreamSocketListener?
3) I want Asynchronous type socket for the server side
For client side :
Does it matter which client to work with SocketServer or StreamSocketListener ? say the client are iOS and Android?
Thanks
Hello to everyone I google email sender and found something but I have promblem with smtp:
Code:
private void button1_Click(object sender, EventArgs e) { MailMessage mail = new MailMessage(textBox1.Text, textBox2.Text, textBox6.Text, textBox7.Text); SmtpClient client = new SmtpClient(textBox3.Text); client.Port = 587; client.Credentials = new System.Net.NetworkCredential(textBox4.Text, textBox5.Text); client.EnableSsl = true; client.Send(mail); MessageBox.Show("Mail Sent!", "Success", MessageBoxButtons.OK); }
and I have problem here:
client.Send(mail);
Icon:
Hi,
I am trying to create a line programmatically using windows form. I am not able to get the properties of the below mentioned items in the image.
Line properties are pulled from RdlObjectmodel
API
.
How can I set the above mentioned properties in the below code.
CODE:
Line ln =newLine();
ln.Name="f1";
ln.Style.Color=System.Drawing.Color.Black;
ln.Left=newReportSize(0.19,SizeTypes.Inch);
ln.Top=newReportSize(0.91SizeTypes.Inch);
ln.Width=newReportSize(1.02,SizeTypes.Inch);
ln.Height=newReportSize(0.04,SizeTypes.Inch);
PrintDialog settings of not default printer are not preserved. If you select a printer different from the proposed Windows Default Printer, the default settings are not taken into account. I've experienced this behaviour with SSRS ReportViewer .net component, but also other applications developed with the framework suffer of this issue.
steps to help us reproduce your issue
In the PrintDialog form choose a printer that differs from Windows Default Printer. Paper settings are not taken from printer default settings. While if you set that printer as default (avoiding to choose another printer in printer selection) the settings are preserved.
When I go to Device manager, section "System Devices", Right click - "Properties", "Details", "Location Information", I get data like:
PCI Bus #, Device #, Function #.
I need it properly to PCI cards, I have tryed with many Root\CIMV2 tables, but still cannot get this data.
With next query I got info from devices, but not location information
ManagementObjectSearcher searcher =new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_PnPEntity");
I'd really appreciate your help.
Thank you
Hi everyone,
I'm implementing an emitted propertychanged handler for my POCO object containing virtual properties, and I've got code that works to the point where propertychanged is being raised whenever I change the underlying property. The reason for doing this is that I am sharing a POCO object with the server (for better or for worse), where I will be sending modified objects to the server. I cannot decorate the object with attributes (since the server would also have these decorations) and I cannot use third-party tools such as Mono.Cecil, Fody or PostSharp due to policies. I need to track whether the object has been modified, and I'm stuck on this.
Here is the Emit that wraps my virtual properties with change notification:
MethodBuilder setMethodBuilder = typeBuilder.DefineMethod(setMethod.Name, setMethod.Attributes, setMethod.ReturnType, types.ToArray());
typeBuilder.DefineMethodOverride(setMethodBuilder, setMethod);
ILGenerator wrapper = setMethodBuilder.GetILGenerator();
...<Emit if (propertyvalue <> value) IsModified=true;>...
wrapper.Emit(OpCodes.Ldarg_0);
wrapper.Emit(OpCodes.Ldarg_1);
wrapper.EmitCall(OpCodes.Call, setMethod, null);
What I need to do is get the set method of the existing "IsModified" boolean property and set it.
Here's an example of what I'd like to emit:
public partial class AnEntity
{
string _myData;
public string MyData
{
get
{
return _myData;
}
set
{
if(_myData <> value) IsModified = true;
_myData = value;
OnPropertyChanged("MyData");
}
}
bool _isModified;
public bool IsModified { get; set; }
{
get
{
return _isModified;
}
set
{
_isModified = value;
OnPropertyChanged("IsModified");
}
}
I've been stuck on this for a while...I have managed to create a new property called "NewIsModified" in the new proxy class that was created, however, I'd very much like to reuse the existing IsModified property in my original POCO.
Any help would be greatly appreciated.
Kind regards.
Hello,
we have encountered a bug (most probably) in debugger of C#(.NET) VS 2015. The situation is following:
// something ....
for (int month = 1; month <= this.MainTariffInsurancePeriod * 12; month++)
{
ProgressionRow progressionRow = getProgressionRow(month);
// something .....
if (progressionRow.ColB_Month == 1)
{
progressionRow.ColBK_BBASE = this.YearlyPremium * (LOWERED_ALLOCATION_YEAR1 + LOWERED_ALLOCATION_YEAR2);
}
// continuation ....
The debugger (not runtime) bug has two demonstrations here:
1. 'month' variable is in debugger presented as value 361 thought in fact is 1 as should be.
2. progressionRow.ColB_Month property value is presented as 3770 though is 1 (program steps in into the if body)
The reason is probably related to the fact that before this code, but within in the same method there is another for loop using 'month' variable and another progressionRow declaration. The debugger shows the values from above definition.
Is there anybody who would care and fix a thing like that?
Thanks
I am experiencing a strange "memory leak" when I am using a pushbutton to start my program. Here is a snippet:
using Kitware.VTK
namespace vtkclasspractice"Body of my code"
}
}
}
My problem is that the memory in "Body of my code" never clears until I get out of the scope of button_test_Click. There is a loop in "Body of my code" that is supposed to re-process ~5MB of image data, but instead it seems as though the memory just adds-up each iteration.
I know this is a problem of the pushbutton, because when I place "Body of my code" right after InitializeComponent(), within the same scope, memory does not grow. It seems as though garbage collection does not work inside of the button_test_Click method.
Any suggestions?