|
Thank you very much!
Have a nice day!
|
|
|
|
|
Greetings,
How do I get the Windows Software Development Kit by Microsoft. I have VS2005 and VS2008 is shipping. Does it come with VS2008 or did it come with VS2005? Or do I have to download/purchase it?
Thanks,
BP
|
|
|
|
|
|
Hi,
I have decided to make a modeling tool in my spare time to improve my skills. The tool will have several nodes and edges. I want to make it so (if possible) that each node has its own renderer, and within that renderer you call the OnPaint method which would paint the node onto a Control.
Does anyone know where I'd start with this? or any links i could read up on.
Also, if someone thinks this way is a bad idea and there is a better way of painting the nodes/edges etc, say so.
Regards,
Gareth.
|
|
|
|
|
Charles Petzold has an excellent book on working with .NET that explains how to do this called "Programming Microsost Windows with C#". It is quite an in depth book and will show you a lot about how the graphics system works.
|
|
|
|
|
|
|
What can I use to sent a FAX with .NET? system.messaging or about IO.Ports? I need an idea or a code sample.
|
|
|
|
|
|
Server Error in '/MemberPhoto' Application.
--------------------------------------------------------------------------------
Value cannot be null.
Parameter name: String
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: String
Source Error:
Line 23: dbConnectionString = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ConnectionString;
Line 24: dbProviderName = ConfigurationManager.ConnectionStrings["MemberPhotoConnection"].ProviderName;
Line 25: productsPerPage = Int32.Parse(ConfigurationManager.AppSettings["ProductsPerPage"]);
Line 26: productDescriptionLength = Int32.Parse(ConfigurationManager.AppSettings["ProductDescriptionLength"]);
Line 27: siteName = ConfigurationManager.AppSettings["SiteName"];
Source File: c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs Line: 25
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: String]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2725203
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
System.Int32.Parse(String s) +20
MemberPhotoConfiguration..cctor() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs:25
[TypeInitializationException: The type initializer for 'MemberPhotoConfiguration' threw an exception.]
MemberPhotoConfiguration.get_DbProviderName() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\MemberPhotoConfiguration.cs:45
GenericDataAccess.CreateCommand() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\GenericDataAccess.cs:111
CatalogAccess.GetDepartments() in c:\Inetpub\wwwroot\MemberPhoto\App_Code\CatalogAccess.cs:54
DepartmentsList.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\MemberPhoto\UserControls\DepartmentsList.ascx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
I am wondering if this message shows that i've not connected to the database.Anyone can help me to solve this problem? There is no error occur in my coding when i debug and only this message comes out when i choose to 'start without debugging'.
When i choose to 'start debugging', another error 'TypeInitializationException was unhandled by user code' shown.
|
|
|
|
|
wsamuel,
"ProductsPerPage" is obviously null.
Line 25: productsPerPage = Int32.Parse(ConfigurationManager.AppSettings["ProductsPerPage"]);
Its got nothing to do with the database. I am sure you posted something VERY similar a week or so go, but was for different line, but the same error...
Regards,
Gareth.
|
|
|
|
|
Server Error in '/MemberPhoto' Application.
--------------------------------------------------------------------------------
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I've got another error for my program. This is obvious because of the connection problem. May i know more precisely what is going on?
|
|
|
|
|
wsamuel,
Well, firstly you should check:
When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
And also your connection string.
Regards,
Gareth.
|
|
|
|
|
Should i instead check on my coding or check on the connection setup? Is there any tutorial or sample showing how to configure the connection?
|
|
|
|
|
Gareth is right. The error message gives you a clue. By default a SQL Server 2005 database only allows connections that originate from applications running on the same database server. You need to the change the Remote Connections settings in the SQL Server 2005 Surface Area Configuration. You'll see that the default is local connections only. You need to change to local and remote connections and pick one of the sub-options.
Can we have a look at the connection string?
|
|
|
|
|
ya sure..
// creates and prepares a new DbCommand object on a new connection
public static DbCommand CreateCommand()
{
// Obtain the database provider name
string dataProviderName = MemberPhotoConfiguration.DbProviderName;
// Obtain the database connection string
string connectionString = MemberPhotoConfiguration.DbConnectionString;
// Create a new data provider factory
DbProviderFactory factory = DbProviderFactories.GetFactory(dataProviderName);
// Obtain a database specific connection object
DbConnection conn = factory.CreateConnection();
// Set the connection string
conn.ConnectionString = connectionString;
// Create a database specific command object
DbCommand comm = conn.CreateCommand();
// Set the command type to stored procedure
comm.CommandType = CommandType.StoredProcedure;
// Return the initialized command object
return comm;
}
Does this means it's the problem with the configuration? I have try the method you recommended by changing the setting but it still didn't work. Is there any other solution for this? Thx!
modified on Sunday, March 30, 2008 10:16 AM
|
|
|
|
|
Dear guru's
I have data-files with some structure in it. These files a continuously read/modified/written/extended/read/.....
Now I have a problem. What happens if just during writing such a file a computer-crash happens? My files are corrupted and the next read-operation will fail.
Two questions:
1.
I know, this is a "standard"-problem which is already solved. Can somebody give me any hint/link to a solution?
2.
This is not directly related to my question.
How can I ensure with .net, that a file is really physically written to hard-disk and not contained in any cache.
Thank you for your help
|
|
|
|
|
Frygreen wrote:
1.
I know, this is a "standard"-problem which is already solved. Can somebody give me any hint/link to a solution?
You may want to keep a temporary file on disk that will be autosaved during the execution of the program. When saving the actual file, you might just copy the temporary file over.
Frygreen wrote: 2.
This is not directly related to my question.
How can I ensure with .net, that a file is really physically written to hard-disk and not contained in any cache.
As far as I know calling Close on a stream will cause the data to be flushed. If you don't want to close the file operation, you may call Flush explicitly.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Frygreen wrote: a computer-crash happens
What u mean by Crash? electricity power is off for example
If so, I think you need to close the file and reopen it betwen different operations
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
yes, by "crash" I mean electric power off.
But even closing and opening does not help a lot, because it can happen that just the last "closing"-operation causes trouble
|
|
|
|
|
Hello!
I am writing an application that works with a SQL Server database,
and in the application I try to run a query which has a dash ('-')
in it. Because of the dash, the query doesn't work.
I guess that the .net compiler understands the dash as a special
character, and sends the wrong query to SQL Server.
Is it right? Or the problem is not this?
How can I solve it?
Thanks!
|
|
|
|
|
Yevgeny Efter,
Post the SQL and maybe we can see why its not working.
Regards,
Gareth.
|
|
|
|
|
Yevgeny Efter wrote: a query which has a dash ('-')
in it. Because of the dash, the query doesn't work.
I guess that the .net compiler understands the dash as a special
character, and sends the wrong query to SQL Server.
Is it right? Or the problem is not this?
The C# compiler (.NET is the framework) will not change your query. So, no, that is not right.
Most likely the SQL code supplied is not legal SQL in the first place.
Yevgeny Efter wrote: How can I solve it?
Since we have no idea of what you have actually written it is difficult to say. There are a number of possibilities but they all depend on where this dash is and why it is there.
For example, is the dash in a column or table name? If so then escape it with square brackets e.g. [my-column-name-with-dashes]
|
|
|
|
|
Thank you! The brackets solved it.
Have a nice day!
|
|
|
|
|
I am using this code to save image...
System.Drawing.Bitmap bi = new System.Drawing.Bitmap(panel1.Width, panel1.Height);<br />
panel1.DrawToBitmap(bi, new System.Drawing.Rectangle(0, 0, panel1.Width, panel1.Height));<br />
bi.Save(@"c:\Bcodetest.jpeg", ImageFormat.Jpeg);
This code running successfully but i want that user can define his own path where he wants to save image how can i do that...
i am using savefiledialog to do that but i am unable to do that...
|
|
|
|