|
ooooww thankss. yes it worksss finee noww..
|
|
|
|
|
In my C# code i have a variable EmbedTextBox.Text = this.OpenFileDialog;
I want to use that same variable's contents in my HTML code e.g.
"<html><value=mms://server/EmbedTextBox.Text></html>"
which does not work.
is there an easy of doing this?
|
|
|
|
|
You need to programatically change the content of "value" during the creation of the HTML-Code.
Remember, even if you have a PHP, ASP or whatever script, it still needs to feed the browser valid HTML-code. So, what the server reads:
<?PHP
echo "<html><head>"
echo "<title>" + $ver + "th version of my site</title></head><body></body></html>"
?>
and sends
"<html></head><title>7th version of my site</title></head><body></body></html>"
Basically, in your code, the browser probably understands that it should fill the textbox with "mms://......." as a string, not with the content behind that link. This you would have to do via client- or server-side scripts, preferrably server-side ones.
Cheers
Sid
|
|
|
|
|
Hi all,
I have a question on c# dll loading in .Net.
Let say two dlls, dll A and dll B, object 1 in dll A
refers to an object 2 in dll B. So, if the object1
is running and invoke object 2 in dll B, will the whole dll B being loaded in the memory or just the
object 2 being loaded ? I ask this question coz I concern on the amount of memory usage.
Thanks
|
|
|
|
|
Hai pyhtang,
At runime, while obj in dll A , refers to obj in dll B,,,, only that particluar object will get loaded in to memory.
A dll is nothing but a class library, hence a dll can contain multiple classes. instatntiating a single class will load only that particlar object into memory.
Regs,
Manivannan.P
|
|
|
|
|
|
Why!?!
I found this interesting bit of text in the C# specification at MSDN here[^], when trying to find out why my code isnt working:
First, the set of all accessible members named N declared in T and the base types of T is constructed. Declarations that include an override modifier are excluded from the set.
Can anyone explain to me why? It seems illogical.
Consider the following:
class A {
public virtual int Foo () { return 1; }
}
class B : A {
new int Foo () { return 2; }
static void Main () { System.Console.WriteLine (new C ().Foo ()); }
}
class C : B {
public override int Foo () { return 3; }
It outputs 2, because the code is executed in B. If B didn't define a Foo() method, it would output 1. Logically (well, to me anyway) it should output 3!
--
Dave
|
|
|
|
|
Hi David.
w.r.to, the code sample,,,,
class B : A {
new int Foo () { return 2; }
static void Main () {System.Console.WriteLine (new C ().Foo ()); }
}
This is an apt example for Hiding Methods. The statement 'new int Foo () { return 2; }' in Class B , informs the compiler that the base class member has been hidden and hence it continues executing the method in B.
w.r.to the statement,
If B didn't define a Foo() method, it would output 1....check out it would output only '3'.
I hope is this what you wanted to clarify.
regards,
Manivannan.P
|
|
|
|
|
I'm having problems trying to figure out where to put an Equals override so ArrayList.Contains(object) will work with a class i have made.
this is what i have.
public class CField
{
public string m_FieldName;
...
}
public class CClause
{
public ArrayList alCField = new ArrayList();
...
{
and i want to do this
if(clause.alCField.Contains(string aFieldName)){...}
This ^^ if statment always fails. I've tryed the folowing in CField:
public override bool Equals(Object obj)
{//Check for null and compare run-time types.
if (obj == null || GetType() != obj.GetType()) return false;
CField f = (CField)obj;
return (this.m_FieldName == f.m_FieldName);
}
My way of thinking says that the abouve if should call the override but it dosn't so i'm stuck. I'm starting to miss the old STL.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
An ArrayList doesn't support searching based on a key (in your case, m_FieldName).
You should implement IComparable and use another container, e.g., a SortedList, wich will allow you to search based on a key.
Yes, even I am blogging now!
|
|
|
|
|
I realized the problem was somewhere else in the code
I did want to point out that while ArrayList doesn't support a key search My_al[keyName] it has two search options, Contains which leverages off of Equals, and BinarySearch which leverages off of the IComparable interface.
Is there an article here that explains how to override Equals and IComparable. The help on MSDN doesn’t give a complex example.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
is there a way i can read a file that was create with print to file (the pcl file) and do a print preview on it
thanks
chad
|
|
|
|
|
hello i am new to C# and im trying to create some arrays
im trying to use an enum to specify the size of the arrow but its not allowing me to do so
here is an example
enum Size {MaxSize = 1};
int[] array;
array = new int[Size.MaxSize]
however when i try to do this im getting compile errors
can someone can me some pointers as to how to work with C# arrays
|
|
|
|
|
new int [] {Size.MaxSize }
You may have to cast it to an int as well.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Try this:
enum Size {MaxSize = 1};
int[] array;
array = new int[(int)Size.MaxSize]
|
|
|
|
|
Hi,
I want to be able to Align the Text (in each column) when printing ListView control. I was able to achieve this by creating rectangles. The RightAlign dosn't seem to work perfectly... any ideas why? Is there a better way to Align the text in each column when printing?
for (int row = 0; row < lv.Items.Count; row++)
{
int nextColumnPosition = lv.Bounds.X;
RectangleF drawRect;
StringFormat stringFormat = new StringFormat();
for (int col = 0; col < lv.Items[row].SubItems.Count; col++)
{
if (lv.Columns[col].TextAlign == HorizontalAlignment.Right)
{
drawRect = new RectangleF(nextColumnPosition + leftMargin, (lv.Items[row].Bounds.Y + lv.Bounds.Y) + topMargin, lv.Columns[col].Width - 3, lv.Bounds.Height);
stringFormat.Alignment = StringAlignment.Far;
}
else if (lv.Columns[col].TextAlign == HorizontalAlignment.Center)
{
drawRect = new RectangleF(nextColumnPosition + leftMargin, (lv.Items[row].Bounds.Y + lv.Bounds.Y) + topMargin, lv.Columns[col].Width, lv.Bounds.Height);
stringFormat.Alignment = StringAlignment.Center;
}
else
{
drawRect = new RectangleF(nextColumnPosition + leftMargin + 3, (lv.Items[row].Bounds.Y + lv.Bounds.Y) + topMargin, lv.Columns[col].Width, lv.Bounds.Height);
stringFormat.Alignment = StringAlignment.Near;
}
//print data
g.DrawString(lv.Items[row].SubItems[col].Text, lv.Items[row].Font, Brushes.Black, drawRect, stringFormat);
//Add the width of the current column to get your next column position
nextColumnPosition += lv.Columns[col].Width;
}
}
thanks,
ron
|
|
|
|
|
I have some "large" image data stored in a message queue, and have a remote program to read from the message queue. The first call of reading queue often takes a long time to finish (20 sec). After that the communication becomes fast. BTW, the message queue is not empty when reading begins.
I tried to run the problem local to the msq, the first call of reading did not cause any problem. I also tried to read "small" image data, and that was fast too.
Any idea what is happening and how to avoid it?
Thanx
|
|
|
|
|
Hi! I want to select only 10 rows from a dataTable each time, just as from a database("SELECT TOP 10 FROM orders WHERE ID <100 ORDER BY ID"). for example:
DataTable myTable = new DataTable("orders");
DataRow[] rows = myTable.Select("TOP 10 ID < 100");
1)How can I write the correct statement.
2)Can I ues "TOP" key word or there's other way to do it?
Thank you very much.
|
|
|
|
|
I'm kinda new to this but this is how i did it.
SqlCommand cmd = new SqlCommand(("SELECT TOP 10 FROM orders WHERE ID <100 ORDER BY ID",SQLConn);
cmd.CommandType = CommandType.Text;
SqlDataReader SQLData = cmd.ExecuteReader();
DataTable My_DataTable = SQLData.GetSchemaTable();
int iColumns = My_DataTable.Rows.Count; //shuld be 10
while(SQLData.Read())
{
string sOut = "";
for(int i=0; i
|
|
|
|
|
After I posted this message I keep searching the net and I find the solution to my problem.
The problem was caused by McAfee VirusScan Enterprise 8.0i's Buffer overflow protection.
I tried to disable it and my comboboxes start working well again.
If someone has the same problem read the document in
this location
|
|
|
|
|
In C or C++ we used to be able to call functions from DLL's by loading the dll library (Ex: LoadLibrary("library.dll");) then using the method GetProcAddress("functionName") to find a function by name in the library.dll.
Now in C# the Dll's contain classes rather than isolated functions.
Is is possible to call functions from Dll's in c#?
I am mainly interested in being able to pass a function name as parameter then use something like the GetProcAddress method that uses that function name to find it in the dll so we can call it.
Example in C++:
//this method will call a function from the library (no error checks to simplify)
void CallFunction(char* libraryName, char* functionName)
{
//declare the function that will be called:
typedef void * (FUNC)(int); //function that returns void and takes an int
FUNC pFunction;
//load dll library:
HINSTANCE hLibrary = LoadLibrary("Library.dll");
//find function in library:
pFunction = (FUNC) GetProcAddress(hLibrary, functionName);
//call function
pFunction(35);
}
|
|
|
|
|
|
|
SqlCommand cmd = null;<br />
<br />
cmd = connDB.CreateCommand();<br />
cmd.CommandText = "INSERT INTO MandantMC (" +<br />
"Mand, " +<br />
"MID, " +<br />
"VALUES " +<br />
"(?,?)";<br />
<br />
cmd.Parameters.Add("Mand", txtBoxMandant.Text.ToString());<br />
cmd.Parameters.Add("MID", txtBoxKürzel.Text.ToString());<br />
<br />
<br />
cmd.ExecuteNonQuery();
The connDB works. But this code does not. I try to get data from textboxes to SQL DB. If I make hardcoded code like :
... VALUES ('W','Y') then it works. But if I want data from controls, there is an error while passing cmd.ExcecuteNonQuery(). Also if I insert the ' ( within an own string ) it doesn't work. Only ' works in CommandText.
Any sols ?
|
|
|
|
|
The SqlClient uses named parameters, so you need to use @Mand and @MID instead of the ?'s in your sql string. In addition, you may need to specify @ when adding the parameters.
my blog
|
|
|
|