|
I wonder if this[^] would have been of any help to you when you started development - its probably too late now.
|
|
|
|
|
|
Hi,
TabPages aren't the easiest controls to design, as you typically can see only one at a time, and Visual Designer doesn't make things very comfortable.
What most people seem to do is:
- for each tab page (1..N), create one specific user control (1..N), i.e. derive from UserControl, add all GUI parts, add code;
- then create tab pages inside the TabControl, and instantiate your user controls, one per page.
This supports collaboration to some extent, as one person can be in charge of the TabControl, whereas several people can create and deliver user controls (you can create separate projects, say one per person for holding user controls, and one overall for the application).
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Can someone give me some books that discusses completely microsoft visual c# 2005 with relational database particularly the ms access database? Because I have a book that has the same discussions but with sql server and with minimal ms access discussion.
|
|
|
|
|
Well, one book that I have found useful is Deitel's C# for Programmers (ISBN 0-13-134591-5). That's what I started with.
Concerning MS Access, here is some code that may help you get started:
OleDbConnection jetDB = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" + AccessFileFullPath + "'");
/// <summary>
/// Handles SQL commands that do not return results, such as CREATE,
/// INSERT, or DELETE.
/// </summary>
/// <param name="SQL">SQL command string (must terminate with semicolon).</param>
public void ExecuteNonQuery(string SQL)
{
OleDbCommand executeCommand = new OleDbCommand(SQL, jetDB);
jetDB.Open();
executeCommand.ExecuteNonQuery();
jetDB.Close();
}
/// <summary>
/// Retrieves data from the specified table or query, using the SQL string
/// passed as a parameter.
/// </summary>
/// <param name="query">SQL string to execute to obtain the Data Table.</param>
/// <returns>A data table populated with the specified query.</returns>
public DataTable ExecuteQuery(string query)
{
DataTable queryResult = new DataTable();
OleDbDataAdapter queryDBA = new OleDbDataAdapter(query, jetDB);
queryDBA.Fill(queryResult);
return queryResult;
}
|
|
|
|
|
if I buy a book about sql server, will i be able to use the sql queries presented in that book to ms access?
|
|
|
|
|
The SQL syntax is very similar, if that's what you are asking. Learning SQL is not the same thing as learning C#, of course.
Here's another example that builds upon the previous one (where coreDB is a class containing the previous code, and the call to Asset is a constructor for another class in the example project that builds from the specific data row). The uppercase component in this one is the SQL used in querying MS Access.
/// <summary>
/// Gets the object array of inventory items.
/// </summary>
/// <param name="orgID">Int ID of the organization.</param>
/// <returns>An arraylist of inventory item listings.</returns>
public ArrayList GetOrgAssets(int orgID)
{
ArrayList result = new ArrayList();
DataTable assets = coreDB.ExecuteQuery
("SELECT * FROM ORGANIZATION_ASSETS WHERE ORGANIZATION_FK = "+orgID.ToString()+";");
foreach (DataRow dr in assets.Rows) result.Add(new Asset(dr));
return result;
}
|
|
|
|
|
I don't doubt that your code works, but whenever I see ArrayList in someone's code I begin to have doubts.
The OP said he had VS2005 so he will most likely be using .NET 2.0 which has generic lists List<T> which should be used instead.
Also, your final foreach loop may possibly be removed by the use of the AddRange method which would be far more efficient.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
List<T> could be employed here (such as List<Asset>).
AddRange won't work in this case however, as it is not an ICollection that is being added. So, while:
result.AddRange(assets.Rows);
would work (if Rows was to be returned), this line:
result.AddRange(new Asset(dr));
would not. (Did you miss that Asset was a class constructor with the row as a parameter?) The returning value in this case is a collection of Asset objects (I have not defined the Asset class here, I just provided the snippet as an example of MS Access interaction).
|
|
|
|
|
I had missed that .
It would require .NET 3.5 and linq to use
Rows.OfType<T>() or similar
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Your book using SQL Server examples should give you enough to get things working. In the .Net Framework, the System.Data namespace are classes for several types of provider, and the syntax for each is nearly identical. For a connection, SQL Server needs SqlConnection, for MS Access you use OleDbConnection. Similarly, while SQL Server uses SqlCommand, Access uses OleDbCommand. The slight differences, if any, in the arguments each method requires can be resolved with the clues given by IntelliSense, or simply using Help in Visual Studio. Try searching Help for 'System.Data.OleDb' and see what classes are revealed.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
when i wanna to connect to sql i get this problem.
My server sql info :
Microsoft sql server 2008 (RTM) - 10.0.1600.22 (interl X86) (build 6002: service Pack 2)
and my system SQL info :
<code>Microsoft sql server 2005 (RTM) - 9.00.1399.06 (interl X86) (build 2600: service Pack 2)</code>
I get this Error :
<code>This version of microsoft sql server management studio can only be used to connect to sql server 2000 and sql server 2005 servers.(ConnectionDlg).</code>
|
|
|
|
|
Go to the Visual Studio Express page at Microsoft.com and download the Management Studio 2008 package. Your existing MS installation can't communicate with the newer SQL Server 2008 system.
( I ran into the same problem, briefly )
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Thanks for ans .
can you please give me the address ?
how much is its size(MB)?
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:53am.
|
|
|
|
|
I am downloading SQL sp3 .
will it help me?
|
|
|
|
|
|
i am downloading sql 2005 sp3.
will it help me?
|
|
|
|
|
No.
You're trying to connect to a SQL Server 2008 instance, and SQL Server 2005 is a whole different animal. Is there a reason that you have to keep SQL Server 2005? If not, I'd recommend that you install the 2008 version everywhere to maintain compatibility. I found that I was unable to install SQL Server 2008 on any machine that has the 2005 version installed - apparently they don't play well together.
If you have no real need to keep SQL Server 2005, I'd uninstall it and install the 2008 version in its place. Be advised, though, that the uninstall doesn't always work well. I had so much trouble with that, I had to install all the new parts on another computer, then access them through the network. I hope it works better for you...
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
I am going to implement a "Select render quality" (high or low)feature into my xna game. A form of achieving this could be:
.... loadingcontent()
if Render is high then
texture = Content.Load<texture2d>("myhighresversion")
else
texture = Content.Load<texture2d>("mylowresversion")
end if
...end loading content()
This way of doin it seems tedious and not very OOP, does any one know a better way of doing this before i result to highschool code full of if statements! :P
Thanks.
|
|
|
|
|
There would actually be only one IF statement
if Render is HIGH
{
load all highres textures
}
else
{
load all lowres textures
}
Another way that occured to me is saving your (hi/low)res versions of textures in separate folders and then do something like
string dir = Render is high ? "high" : "low";
texture = Content.Load<Texture2D>(dir + "/mytexture");
... etc.
Honza
|
|
|
|
|
Thanks the second option seems better
|
|
|
|
|
Hi All,
Is it possible to calculate pixel intensity in Candela using RGB values?
Thanks,
Shrini
|
|
|
|
|
Not accurately. Since Candela is a measure of blackbody radiation (or actual light emitted if you like), it is going to depend on the monitor and monitor settings. Wind the Brightness up, N + x candela. Alter the Contrast, N +/- y candela depending on colour.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Hi,
Thanks for reply.
I'm writing in detail what I want to do.
I'm taking image of the object. The object has a portion which glows and image is captured. I want to measure the intensity of that portion in candela. Is there any way to do it?
Thanks,
Shrini
|
|
|
|