|
What do you want to know?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
I'm in intermediate level of C#, I know all the essentials very well, and OOP, I also know the essentials of LINQ, XML, and SQL. But however I'm not that good in practice, I'm thinking to stop learn new things, and concentrate on practicing and learn through it, but I don’t know from where to start! Most books do this but for beginners and then I spend a lot of time time in reading things I know well. So I want sources that concentrate on practicing and developing real projects, with skipping the essential stuff. I want sources to fit my level, or any suggestions from you.
please help me with your experience.
|
|
|
|
|
Go to the articles section here on CodeProject and look at some of the more advanced subjects.
|
|
|
|
|
Find something you want to code and start coding. I learn best by doing. You could even help out on an Open Source project. You just have to push your boundaries.
--Edited--
Sounded kinda harsh.
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
In my opinion the best way to learn something is to do a project that you are interested in.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I've known programmers you get stuck reading books and articles. It's like reading techniques on painting. You will not get any better at painting until you keep painting. Same applies to programming.
Enough with the reading!
Start build apps, a TODO list, with a SQL Backend; or maybe an application that connects to Facebook. Once you build the apps, reflect on the apps from a OOP perspective and performance algorithm. How can you improve the app? Then on the next project apply what you learned. Be flexible, don't be afraid to try something new. But don't get too much into reading. Just pick it up, and start coding!
Something very crucial is to do short projects. Don't try to do to many things. Limit yourself to one project a week, and then move on. Before you know it, you will have learned so much from building those apps!
H.B.
|
|
|
|
|
Hi All
First of all, sorry for my bad english and forgive if my question is'nt so clear.
I'm developing a series of classes to create a framework for my job.
I created this series of class:
baseform : from (empty form)
inputform : baseform
in this form i added two buttons
btnOk & btnAbort
on click these buttons calls two virtual methods that returns a bool, the two methods are respectively ExecuteOK() & QueryAbort()
BrowseForm:inputform
in this form i adedd only a grid ....
Finally in the executable i created a class, BRWTEST, derived from BrowseForm that override the ExecuteOK() method.
When i execute the project with my suprise i see that pressing OK Button (btnOK) the method called is inputform.ExecuteOK and not BRWTEST.ExecuteOK()
I have tested in another solution using simpler classes (in the framework there are many other classes) the same hierarchy ... and double surprise the behavior is correct ... derived class, pressing ok button call override method() ....
So my question is ... can you suggest me where i'm in error ? i have compared the two solution but nothing ....
Please help me
Last Thing ... i'm using SharpDevelop but i don't think that this can be affect the result.
Ask me if some things are not clear.
|
|
|
|
|
OK: I just tried exactly what you did in VS:
public partial class InputForm : BaseForm
{
public InputForm()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Console.WriteLine("Click");
Console.WriteLine("{0}", ExecuteOK());
}
public virtual bool ExecuteOK()
{
Console.WriteLine("InputForm:ExecuteOK");
return true;
}
}
public partial class BrowseForm : InputForm
{
public BrowseForm()
{
InitializeComponent();
}
public override bool ExecuteOK()
{
Console.WriteLine("BrowseForm:ExecuteOK");
return false;
}
}
And then created an instance from my main form:
private void button1_Click(object sender, EventArgs e)
{
BrowseForm bf = new BrowseForm();
bf.Show();
}
I click button1 in my main form, and the BrowseForm shows.
Click the ok button in the Browse form, and I get what I expect:
Click
BrowseForm:ExecuteOK
False
So...what have I done different to you?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Your code is essentially like my code ... but .
In my Solution there are many dll the BaseForm and InpuForm are in the same dll same namespace. The Browseform class is in another dll with same namespace.
I think that this is the only real difference with your code, but in the other simplified test solution i reproduced same namespace ecc.. and all seem work ok but in the working solution the things don't work.
i don't know where i can throw my head!
The solution is big. But if you think i can send the entire solution.
Thanks anyway in advance.
ps:
another difference i don't istantiate direcly browseform in the xecutable project, but i create another class derived by browseform and use that class, but i think that this is not a problem.
|
|
|
|
|
Deriving another class and instantiating that shouldn't make any difference (and doesn't, I just tested it)
Using it from "another dll with same namespace" opens up some possibilities though.
The first one which springs to mind is does the BrowseForm exist in the "main" Assembly as well as in the DLL? Because if it does there is a good chance the system will be calling that one rather than the DLL version. If that doesn't override ExecuteOK, it would give the results you get.
The second is simpler: has the other DLL been compiled since the ExecuteOK was added, and are you using the correct version? I have to say, using the same namespace in two different assemblies is not something I'd want to do: To my mind, it's going to be confusing to coders, never mind the system!
I generally keep to "one assembly, one namespace", and although occasionally I'll have more than one namespace in an assembly, I don't like it, and wouldn't want to "split" a namespace across assemblies.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
First of all
I beg your pardon because (predictably) my error was a my big distraction error.
At the same time thank you very much.
My error wasn't in the costruction of dll's or the classes (i have a different namespace for any dll, not namespaces between dll) i was concentrated to see th error in the intermediate classes, but the error was in the exe project ... infact i instantieted the browseform class and not the last derived class with overriden method().
I discovered this only because i tried to get the various code in a notepad for posting it ... and i saw the elephant.
Thanks again.
Emanuele
|
|
|
|
|
Yeah, reading the code you meant to write... I do it as well
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
1)No connection could be made because the target machine actively refused it
2)
System.Data.SqlClient.SqlException was unhandled
Message=Login failed for user 'sa'.
Source=.Net SqlClient Data Provider
ErrorCode=-2146232060
Class=14
LineNumber=65536
Number=18456
Procedure=""
Server=.
State=1
StackTrace:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at TrustedParty.Keydistribute.button1_Click(Object sender, EventArgs e) in E:\E DRIVE\all proj-rar files\SKIT\TrustedParty\Keydistribute.cs:line 111
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at TrustedParty.Program.Main(String[] args) in E:\E DRIVE\all proj-rar files\SKIT\TrustedParty\Program.cs:line 22
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
|
|
|
|
|
So, put a break-point at the start of your code, single-step through it using Visual Studio (F11) when it hits the break-point, and then include in your post here on what line the error occurred.
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
|
|
|
|
|
Have you tried google?
Eg. this might help.[^]
copy/pasting the error message in google often works miracles
|
|
|
|
|
Member 11432197 wrote: Message=Login failed for user 'sa'.
Basically the code isn't logging in correctly. There are a few causes:
- You haven't provided any password for the account "sa"
- You haven't provided the correct password for the account "sa"
- The account sa doesn't exist where you are trying to log in
- The server isn't configured to allow sql authentication (it isn't in mixed mode in the case of MS SQL server) - this is less likely
How you fix this is another matter - you need to provide the correct credentials (username and password) in either code in your web/app .config. Note that config is better as you can encrypt the information.
Slightly off topic, but logging in as "sa" (system administrator)
|
|
|
|
|
How to add an edit button on first row of gridview.
Upendra Pratap Shahi
|
|
|
|
|
|
My project is to implement the comparison between RSA and ECC.For that i need the source code of ecc for encryption and decryption.i did'nt get the proper code to implement ecc.so plz help me by providing it.
|
|
|
|
|
|
by using c# code how to transfer the entire english windows form into arabic language
|
|
|
|
|
look up satellite assemblies...
basically you define "resources" which is a table with key/value pairs. You have one for each language.
|
|
|
|
|
Hi I am binding data of same table in two different data grid view in the same form. It includes removing and filtering of the rows.
There are two biding source for the two dgv. But it sometimes it shows some weird behaviours on the data.
Can you explain what possible goes wrong.
|
|
|
|
|
Member 11431015 wrote: But it sometimes it shows some weird behaviours Please do not assume that people can guess what that means.
|
|
|
|
|