|
I see.
As lmoelleb already pointed out at the time, the code is utter nonsense.
The only scenario where this code might be the useful is if you deliberately want to produce a compiler error. Even then it's hardly the best code, as the same result can be obtained with much simpler code, e.g.:
char c = "";
---
b { font-weight: normal; }
|
|
|
|
|
LOL
So i won't even think of using that piece of code....
Thank yo for your help.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
I see you are the one who gave me this example, and this is the one i used...
so i suppose no harm done......
strNum = strNum.SubString(0, strNum.Length - 1);
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
hi all,
how can i create checkboxes dynamically in a C#.net2005 WEindows application..
Thanks in advance..
|
|
|
|
|
Create a CheckBox control and add it to the form.
---
b { font-weight: normal; }
|
|
|
|
|
<br />
<br />
CheckBox myBox = new CheckBox();<br />
<br />
myBox.Checked = true;<br />
<br />
myPanel.Controls.Add( myCheckBox );<br />
<br />
Regards
Malc
*********************************************
|
|
|
|
|
The example you were given is sort of right, but if you want to see the checkbox whre you want it, you need to set the Left, Top, Width and Height properties as well.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi all,
I am working on DXF formats in c#.NET in windows applications.i was struck with reading data from dxf formats i.e.,importing data.how to import the data according to the requirement of the values....Plz help me ASAP.
advance in thanks,
cnr.
|
|
|
|
|
1. Search the net for a specification of the dxf format to learn how data are organized.
2. Choose an appropriate reader (binary, text, xml, ..) according to the way data are stored in dxf format.
3. Finally read the data with the chosen reader in a way the dxf format specification implies.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi
i want to make a application just like setup wizard.
form are should be appear by a next click in a main form one by one .
but next button shold be static for all form
how can i do that
Plz tell me simple solution
Parshant
|
|
|
|
|
Hello
Instead of making a form for each step; make a single form for your wizard. Now in the design mode, make each page's controls -textboxes, comboboxes, listboxes, etc..- in a container such as Panel , or a GroupBox . Put all Panels on top of each other -It will be a bit of a miss in the design mode I know -, and hide them all except the first page. Under the panels make you next/back buttons to hide/show pages asd requested by the user.
Regards
|
|
|
|
|
RichEditCtrl
Is it possible to create a richeditcontrol with ruler on top and row number on left side using Visual Studio .Net 2005 C# with the following features?
1.RichEditCtrl should allow bytewise cursor movement ( not characterwise)
2.Inside the control, horizontal and vertical lines need to be drawn along with the other language text.
Shanthi.M
|
|
|
|
|
shan2k wrote: Is it possible to create a richeditcontrol with ruler on top and row number on left side using Visual Studio .Net 2005 C# with the following features?
Impossible is nothing
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi All,
I use this code to set value for store procedure parameter. Then it is OK.
report.Load(@"..\..\Reports\CrystalReport2.rpt");
report.SetParameterValue(0, "test");
crystalReportViewer1.ReportSource = report;
But when I use SetConnection for this report then the parameter can't get value which I set.
report.Load(@"..\..\Reports\CrystalReport2.rpt");
report.SetParameterValue(0, "test");
foreach (CrystalDecisions.Shared.IConnectionInfo connection in report.DataSourceConnections)
{
connection.SetConnection(serverName1, database, userID, password);
}
crystalReportViewer1.ReportSource = report;
Could any one help me what wrong of this code.
|
|
|
|
|
Hi Every body,
This is prasad. i want some information about webservies.i want to know how to call the webservies . i did the webservices in my local system but i don't know how to call the weather & Time webservies form their providers. So ,Please can any bosy hepl me regarding in this concept .
Thanks & Regards,
T.GuruPrasad Reddy.
|
|
|
|
|
You add a reference to your webservice in the IDE, which creates classes that handle connecting to the service, you call the classes as if they were local to you, there's no additional work required.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
I've got an application up and running, using remoting.
Things generally seem to work, but there seem to be problems with returning ArrayLists from the remote object.
I have some small helper classes to use in passing around data, and if I add any of these to an ArrayList, and then try to return the ArrayList, I get a RemotingException on the client side. Returning an empty ArrayList, or one that contains only .NET builtin types works though.
Is there something special I need to do to allow classes I've defined to be returned in the ArrayList?
|
|
|
|
|
Your class has to be attributed Serializable, just like if you were going to serialize it to an XML file.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Brilliant, thanks. A few little [Serializable] tags, and everything works now.
|
|
|
|
|
Greetings!
I'm trying to connect to a database and read certain fields from it. I'm unable to read any fields from it and would appreciate your help debugging/fixing the problem.
Here is what I have:
1. A file that acts has the database interface code:
<br />
public class AppDatabaseInterface<br />
{<br />
<br />
private string m_cstrDefaultdbDir = "C:\\";<br />
<br />
private const string m_cstrDBFileName = "DefaultDatabase.mdb";<br />
<br />
private System.Data.OleDb.OleDbConnection m_dbConn;<br />
<br />
public AppDatabaseInterface()<br />
{<br />
System.Reflection.Assembly assm =<br />
System.Reflection.Assembly.GetAssembly(System.Type.GetType("AppDatabase.AppDatabaseInterface"));<br />
m_cstrDefaultdbDir = System.IO.Path.GetDirectoryName(assm.CodeBase.ToString());<br />
m_cstrDefaultdbDir = m_cstrDefaultdbDir.Remove(0, 6);
<br />
OpenDatabase();<br />
}<br />
<br />
<br />
private void OpenDatabase()<br />
{<br />
lock (this)<br />
{<br />
if (m_dbConn == null)<br />
{<br />
m_dbConn = new OleDbConnection();<br />
}<br />
else<br />
{<br />
if (m_dbConn.State != ConnectionState.Closed)<br />
{<br />
m_dbConn.Close();<br />
}<br />
}<br />
<br />
try<br />
{<br />
m_dbConn.ConnectionString = string.Format(<br />
@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}\{1};",<br />
m_cstrDefaultdbDir, m_cstrDBFileName);<br />
}<br />
catch<br />
{<br />
Console.WriteLine("Could not open database");<br />
}<br />
m_dbConn.Open();<br />
<br />
}<br />
}<br />
2. The actual UI form
<br />
public partial class frmAppDatabase: Form<br />
{<br />
AppDatabaseInterface m_database;<br />
<br />
public frmSpeakerDatabase()<br />
{<br />
InitializeComponent();<br />
<br />
m_database = new AppDatabaseInterface();<br />
<br />
string[] strSpeakerMakes = m_database.Makes;<br />
<br />
for (int i = 0; i < strSpeakerMakes.Length; i++)<br />
{<br />
cbSpeakerMakes.Items.Add(strSpeakerMakes[i]);<br />
}<br />
}<br />
What I want this portion of the code to do is to fill in the combobox with the various items from the specified field in the database. However, I see nothing.
The Access file is in the \bin\debug directory of the project.
Could you please advice me as to what is wrong?
Thanks!
|
|
|
|
|
TheBlindWatchmaker wrote: However, I see nothing.
You see nothing? Not even the error message?
You are trying to use the property "Makes", but you have not created any property with that name. What do you expect to happen?
---
b { font-weight: normal; }
|
|
|
|
|
Oops! My mistake!
Here's the "Makes" method in the AppDatabaseInterface.cs file
<br />
public string[] Models(string make)<br />
{<br />
{<br />
OleDbDataReader dbr = null;<br />
ArrayList Models = new ArrayList();<br />
<br />
OleDbCommand cmd = new OleDbCommand(string.Format("SELECT * FROM {0};", "Speakers"), m_dbConn);<br />
dbr = cmd.ExecuteReader();<br />
<br />
while (dbr.Read())<br />
{<br />
<br />
string dbMake = "";<br />
string model= "";<br />
for (int it = 0; it < dbr.FieldCount; it++)<br />
{<br />
string strField = dbr.GetName(it);<br />
if (strField == "MAKE")<br />
{<br />
dbMake = (string)dbr.GetValue(it);<br />
}<br />
if (strField == "MODEL")<br />
{<br />
model = (string)dbr.GetValue(it);<br />
}<br />
}<br />
if (dbMake == make)<br />
Models.Add(model);<br />
<br />
}<br />
string[] strModels = new string[Models.Count];<br />
int i = 0;<br />
foreach (object o in Models)<br />
{<br />
strModels[i++] = (string)o;<br />
}<br />
return strModels;<br />
}<br />
}<br />
Thanks!
|
|
|
|
|
TheBlindWatchmaker wrote: Here's the "Makes" method in the AppDatabaseInterface.cs file
No, it isn't.
---
b { font-weight: normal; }
|
|
|
|
|
Damnit! I'm really inept today! Apologies, apologies!
This might be it!
<br />
public string[] Makes<br />
{<br />
get<br />
{<br />
OleDbDataReader dbr = null;<br />
ArrayList Makes = new ArrayList();<br />
<br />
OleDbCommand cmd = new OleDbCommand(string.Format("SELECT * FROM {0};", "Speakers"), m_dbConn);<br />
dbr = cmd.ExecuteReader();<br />
<br />
while (dbr.Read())<br />
{<br />
for (int it = 0; it < dbr.FieldCount; it++)<br />
{<br />
string strField = dbr.GetName(it);<br />
if (strField == "MAKE")<br />
{<br />
string make = (string)dbr.GetValue(it);<br />
bool found = false;<br />
foreach (object o in Makes)<br />
{<br />
if ((string)o == make)<br />
{<br />
found = true;<br />
break;<br />
}<br />
}<br />
if (found)<br />
Makes.Add(make);<br />
break;<br />
}<br />
<br />
}<br />
<br />
}<br />
string[] strMakes = new string[Makes.Count];<br />
int i= 0;<br />
foreach (object o in Makes)<br />
{<br />
strMakes[i++] = (string)o;<br />
}<br />
return strMakes;<br />
}<br />
}<br />
|
|
|
|