|
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 />
|
|
|
|
|
I see. The method does exactly what it should, and returns an empty array.
You only add to the ArrayList duplicates of values that already exist in the list, but as you start with an empty list, there are never any duplicates, so it will always remain empty.
I guess that your intention was to add the values that aren't duplicates?
In that case, why don't you just get the unique values from the database in the first place? And if you specify what field you want instead of using "select *", you don't have to loop through the fields looking for the one you want.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa,
The Makes field has, say, 10 speakers from Mfr1, 10 from Mfr2 etc. I want the combo box to show Mfr1, Mfr2 and so on.
How would you suggest I do this?
Thanks for your time!
|
|
|
|
|
Select only the field containing the data that you want, and use the distinct keyword to get only one of each value.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I'm trying to write as a small project a custom file explorer in C# however I've hit a rather annoying problem... When a file is > 260 characters long (yeah, I know people shouldn't have files that long, but they do) it'll throw the PathTooLongException fine, but what do you do next?
I was hoping I'd be able to catch that exception and at the same time still get the file size and other information I need to display but no such luck.
Is there any work-around's to fix this, or would the only acceptable solution be to write a custom library that properly wraps the Win32 API functions which are able to get the sizes/other information of > 260 char files? If so does anyone know an open-source library already made to do this, or will I need to make one?
Thanks!
|
|
|
|
|
I'm able to set unsafe mode in a console application by checking the checkbox in "Project Properties -> Build -> Allow unsafe code" however that option isn't available in a web service project.
So how can I set a web service project to unsafe mode?
Thanks.
-Goalie35
|
|
|
|
|
Is there a simple way to parse a string that contains escape character to the appropriate string, and vise versa?
For example, given the following string:
"hello\tthere"
should be parsed to:
"hello there"
and vs.
I need these methods because i let the user to enter escape chracters within the strings.
Thnaks!
|
|
|
|