|
C#:
-Programming C#, Jessy Liberty.: ISBN 0596003099
-C# and the .Net Platform : ISBN 1893115593
.NET
-.NET Framework Essentials, 2E : ISBN 0596003021
I prefer bookpool, ( www.bookpool.com)( Save some money here)
You can preview books @ http://safari.oreilly.com
Cheers
Candy
|
|
|
|
|
I have a datagrid bound to a dataset but its not displaying the table - initially all it shows is a '+', if I click on this it expands to 'Tables', and if I click on that I get the table that I want displayed.
Can anyone enlighten me as to why it doesn't display the table directly?
Here is the database code (all this is done in the Form_Load handler)...
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"
+ "User Id=Admin;Password=;"
+ @"Data Source=C:\Visual Studio Projects\mscale\debug\di-80product.mdb;";
conn.Open();
OleDbDataAdapter adapter = new OleDbDataAdapter();
OleDbCommand selectCmd = new OleDbCommand("SELECT * FROM PRODUCT", conn);
adapter.SelectCommand = selectCmd;
DataSet ds = new DataSet("ds");
dataGrid1.DataMember = "PRODUCT";
dataGrid1.DataSource = ds;
adapter.Fill(ds);
|
|
|
|
|
Never mind, figured this one out finally, all it needed was to specify the table name in the Fill method:
adapter.Fill(ds, "PRODUCT");
Bingo! works
|
|
|
|
|
Hi
I want to use a combobox in a listview as one of the row items.
The user can then see all relevant rows and then select an item from the
combobox without my having to use a popup window for this entry.
I'm sure this was covered in a teched/MSDN session, but can anyone show me
how this is done?
Thanks
Simon
Cheers,
Simon
X-5 452 rules.
|
|
|
|
|
Doesn't it irritate you when seemingly innocuous changes to a control or form render the VS.NET designer useless? Change one little thing and you end up with any number of obscure error messages, my personal favorite
"An error occured while loading the document. Fix the error, and then load the document again. The error message follows. Unspecified error"
I'm actually getting used to not using the forms designer at all because of this.
Has anyone experienced something similar? I'm on RC1
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
The only time I had the designer do that to me was when something was at fault in my code, especially in the drawing code.
If your code throws an uncaught exception this causes the big red x you see in the form.
Hopefully this will at least give you some reason as to why you get the designer errors.
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Thanks James, but why then does removing the offending code usually not help?
Just another wannabe code junky
|
|
|
|
|
Senkwe Chanda wrote:
but why then does removing the offending code usually not help?
Off the top of my head it might be pulling a previous version up; I had a very hard time getting VS.NET to sync the latest build of the control and my test projects.
What I wound up doing was having 2 VS.NETs open, one to work on my control the other to do testing with; before I would compile the control I would remove the reference to it from the project; recompile the control then re-add the reference.
This was before I found out about project references though, and now I don't have VS.NET installed so I can't see if that solves the problems I was experiencing.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
I had a terrible time getting my control icons to work. I finally discovered that VS.NET was caching the icons based on the assembly version. I had no AssemblyInfo.cs file (or its equivalent) and so my version stayed at 0.0.0.0 and my icon was not changing. Once I set my version to 1.0.0.* my icons worked properly.
Otherwise I have no problem using controls from one project in another project under the same solution and under the same instance of the IDE. I just have to remember to build my control assembly before trying to use it (ie in the Form Designer of another project).
--
Peter Stephens
|
|
|
|
|
How does one create explorer bars and desk bands in C#? The standard library doesn't seem to have this prepackaged.
Thanks.
|
|
|
|
|
What are the key differences between these two technologies...?
Anytihng I have written in MFC, will it port fairly easily to MFC...?
Example...if I use the intel RTDSC instruction...?
Is the windows API still available...?
Will a generic C++ class be useable...?
Thanx!!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
What are the differences between apple and orange?;)
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
I'm sorry if this is a newbie question, but I am trying to spawn another process from within a C# application, loading up an external tool such as a batch file or an executable with command line parameters and such. What do I need to do to do this? Thanks,
Andy Luedke
|
|
|
|
|
The System.Diagnostics.Process class lets you start up and control a process (ie program)
There's quite a bit of info to go along with that so its best that you look it up before using it
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Hi!
Has anyone had any attempts on using the system.web.hosting classes for hosting ASP.NET pages outside IIS.
I'm trying to build a simple ASP server to service some localy hosted ASP pages on a machine that does not have IIS installed.Building the server and client itself is not a problem, but I can't seem to understand how/what the server will have to do to process the pages and return the result to the client.
Anyone?
Regards,
Roger
|
|
|
|
|
Hi,
I'm trying to write caption on my main window.
hTheme = OpenThemeData(hWnd, L"MyClass");
but above code always returns hTheme as NULL.
Am I missing soemthing here?
Thanks for help.
|
|
|
|
|
Magic is a user interface library written in C# for .NET, all the source and samples are available free of charge for download. Version 1.1 has now been released.
Features...
Docking Windows
TabControl
InertButton
MenuItem dervied class
Phil Wright
uk_phil_wright@hotmail.com
|
|
|
|
|
//
// What am I doing wrong here?
//
using System;
using System.Net.Sockets;
using System.Threading;
class Class1
{
[STAThread]
static void Main(string[] args)
{
WorkerClass w = new WorkerClass();
// If I call the Start method on the
// main thread, the code works properly
// w.Start();
// But I want to run the code on a own worker thread.
// However, the code will throw an exception.
// Unhandled Exception: System.IO.IOException:
// Unable to read data from the transport connection.
// ---> System.Net.Sockets.SocketException:
// The I/O operation has been aborted because of either a thread exit or an application request
Thread workerThread = new Thread(new ThreadStart(w.Start));
workerThread.Start();
Console.ReadLine();
}
}
class WorkerClass
{
private TcpClient tcp;
private AsyncCallback readCallback;
private byte[] buffer;
public void Start()
{
buffer = new byte[1024];
readCallback = new AsyncCallback(ReadComplete);
tcp = new TcpClient();
tcp.Connect("www.microsoft.com", 80);
byte[] request = System.Text.ASCIIEncoding.ASCII.GetBytes("GET /\n\n");
tcp.GetStream().Write(request, 0, request.Length);
ReadStart();
}
private void ReadStart()
{
tcp.GetStream().BeginRead(buffer, 0, buffer.Length, readCallback, null);
}
private void ReadComplete(IAsyncResult ar)
{
int bytesRead = tcp.GetStream().EndRead(ar);
Console.WriteLine("{0} bytes read.", bytesRead);
if (tcp.GetStream().DataAvailable)
ReadStart();
}
}
---
John R. Lewis
john@aspZone.com
|
|
|
|
|
I come from an MFC background where in general the hungarian naming convention is used: variables are preceded by a mnemonic representing their type, e.g. an int starts with 'n' - "nCount", a string starts with 'str' - "strName", etc. Also member variables in a class are preceded by 'm_'.
Looking through the sample code in VS.NET it is obvious this kind of naming convention is not used in C# so what is generally used? Does Microsoft specify any standard?
|
|
|
|
|
I was reading somewhere recently that Microsoft no longer recommends nor uses Hungarian.
"Thank you, thank you very much" Elvis.
|
|
|
|
|
|
MS doesn't suggest using hungarian notation anymore, instead they suggest using, um... I forget the word :-P
For publicly accessable variables/properties/fields use MyVariable
For private variables/properties/fields use myVariable [Camel casing?]
Method names regardless of scope use MyMethod, classes the same MyClass.
For exceptions end the exception name with Exception, attributes should end with Attribute.
Thats all i can remember right now [not at my home PC].
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Thanks for that. What about things like forms and form controls, I've seen prefixes of 'btn' used for Button controls and 'frm' used for Forms. Or is that just VB programmers who won't give up their bad habits?
|
|
|
|
|
I think its VB programmers who don't give up bad habits.
I've switched from lstItems for a listbox of Items to just plain Items if its the only one, or itemsLst (or even itemsList) if there is more than one 'items' object.
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
James T. Johnson wrote:
For publicly accessable variables/properties/fields use MyVariable
For private variables/properties/fields use myVariable [Camel casing?]
Hmmm, I've gotten used to NEVER creating publicly accessable variables or fields, preferring instead to provide access to them via properties. Is that unecessarily innefficient do you think?
Just another wannabe code junky
|
|
|
|