|
Thanks, works beautifully, I figured the problem was the Async sending but I wasn't sure.
|
|
|
|
|
who's use powerbuilder tool or have ebook ! please help me.
thank you very much.
|
|
|
|
|
Hi folks,
I want to write a piece of code to check if a domain user is member of a local group in my machine. I've read some articles but I don't think I can use LDAP here.
Could you guys give me a hint?
Thanks a bunch.
|
|
|
|
|
Hi,
I'm trying to write an Out of proc DCOM server in C#. I have the Server written, its now a COM object so thats done.
Where i'm stuck is this. As far as I kmow, DCOM works by having a stub object on the machine that the server is running on, and then a proxy on each of the client machines that communicates with the stub object.
How are the stub and proxy objects created? I'm told that in C++, they are created automatically but I am developing this in C# so I need to know if it works the same. The client is written in C++ and the DCOM server is written in C#.
Any help or comments will be appreciated
Thanks
Millzy
|
|
|
|
|
hi to all of you, i'm developing a voice over IP application
i need it for a web page also
i studied the directX to include directX sound i suppose
i need it but that didn't work on asp.net
all i found over the internet is applications made in c++
i needed for .net languages so i have 2 questions :
1- is directX Applicable in web pages
2- the way to develop a library of my own what do need to code in this library so i can used it as a component
i really do need help about this cause i found such components on the internet but are not for free
and if i buy it i don't suppose they send me the source code
so for all the experienced out there DO YOU HAVE THE SOLUTION i need HELP
send me mail to charbel_zibara@hotmail.com
|
|
|
|
|
ASP.NET is a server-side only technology that generated HTML pages for a client. You cannot use DirectX in an ASP.NET app. Since a web page cannot access hardware on the client computer, you'll have to develop a control that the client will have to install to do VoIP. No, I don't have ANY code to do this, nor do I have any source of information on it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How could I change the format of the DateTime ?
The local Date is in the "dd-mm-yyyy" but SqlDbType is in "mm-dd-yyyy" format .
Thanks in advance.
|
|
|
|
|
We use
time.ToString("G", DateTimeFormatInfo.InvariantInfo);
and you should also consider using
time.ToUniversalTime();
before storing times in the database, to avoid problems with daylight saving.
|
|
|
|
|
If you want to store a date in SQL server, use parametized queeries, and that'll solve the problem, in any format SQL Server uses.
DateTime myDateTime = .....
string sql = "UPDATE People SET BirthDate = @Date WHERE ID_person = 1";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.Add("@Date", myDateTime);
cmd.ExecuteNonQuery(); That will save the correct date, no matter what format is the local computer, and/or SQL Server's computer using.
Alternatively, there's a way to change the date format for SQL Server, but I don't remember the exact syntax. Using parametized queries, I don't need it.
Also, parametized queries help avoid SQL injection attacks, so I'll recommend them for every circumstance.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hi,
easy way is give dateTime as string Format..
ex:-
DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt")
Now No need to worry when local time and sqldbtype is different.
regards,
pubudu.
|
|
|
|
|
Hello,
In Windows Forms, I have a datagrid that is sortable by clicking on the column headers.
Say 2nd record is already selected and I sort the datagrid.
Now the previously selected row is unselected. At this point how do I get the index to this previously selected row to have it selected again.
Thank you.
|
|
|
|
|
In the sort event ,Just before the sorting itself ,take that value and put it in any other field and then retrieve it when you want.
|
|
|
|
|
Sorry but I have no clue what you are referring to!
What sort event? There is no sort event. There is only an event called ListChanged in the datagrid's dataview that fires on (and not before) sorting the datagrid. Another thing is, the dataset still has the same indexing order on the datagrid, meaning, a particular row's index before or after sorting remains intact eventhough after sorting it's position on the datagrid has changed.
|
|
|
|
|
Hi,
I have a possible solution for you - it has a couple of drawbacks, but might help.
This example assumes that you have a DataGrid called dataGrid1, who's DataSource is a DataTable called dt.
It also assumes that you've declared an ArrayList called al.
First of all, set the "AllowSorting" property of dataGrid1 to "false" - you have to sort it manually.
Then add the following event handler code (don't forget to wire it up to dataGrid1's DataGrid1MouseDown event in the Properties Grid).
void DataGrid1MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
if(e.Button == MouseButtons.Left)
{
if (hti.Type == DataGrid.HitTestType.ColumnHeader)
{
DataColumn dc;
dc = dt.Columns[hti.Column];
al = new ArrayList();
for(int i = 0; i < dt.Rows.Count; i++)
{
if (dataGrid1.IsSelected(i))
{
listBox1.Items.Add(dt.Rows[i][0].ToString());
al.Add(dt.Rows[i][0].ToString());
}
}
SortData(dc.ColumnName);
}
}
}
This has basically saved the column1 contents of each selected row in an array, so we can later "re-select" the correct rows.
Now add the following code for the SortData method.
private void SortData(string colname)
{
DataRow[] drarray;
drarray = dt.Select(null, colname,
DataViewRowState.CurrentRows);
int len = drarray.Length;
for (int i = 0 ; i < drarray.Length ; i++)
{
DataRow dr = dt.NewRow();
for (int j = 0; j < dt.Columns.Count; j++)
{
dr[j] = drarray[i][j];
}
dt.Rows.Add(dr);
}
for (int i = len - 1 ; i >=0 ; i--)
{
dt.Rows.RemoveAt(i);
}
for (int i = 0; i < dt.Rows.Count; i++)
{
if (al.Contains(dt.Rows[i][0].ToString()))
{
dataGrid1.Select(i);
}
}
}
This sorts the original DataTable into an array, adds the sorted records to the end of the DataTable, then deletes the original ones.
It then checks each row in the DataTable, and if the data in column1 matches the saved data in the ArrayList, it marks the corresponding rows in the DataGrid as "Selected".
Therefore, multiple selected rows are supported.
Limitations:
1. It only supports ascending sorts.
You might want to build a better sort using an IComparer
interface.
2. You lose the little arrows on the column headers.
3. It assumes that the data in Column1 of the DataTable is unique.
You could combine data from more than one column to create a
unique key.
Hopefully this will help get on the right track.
Good luck!
Gary Perkin.
PS I think the Sort Event that the previous respondent was referring to is available in WebForms, but I may be wrong...
|
|
|
|
|
Thank you very much for taking the time to reply.
This is a good start. I think if I replace datatable with dataview I could get it sorted both ways...
Still, I don't understand the usefulness of ability to sort via clicking on column headers, unless you don't want to select a row.
|
|
|
|
|
how can i transfer the data between different forms if that data is created in one form and i need to transfer it to another form within the same application .
Miss With The Best And Die Like The Rest
|
|
|
|
|
I have tried to answer this question on your previous post. There are many ways to achieve what you are trying. First of all, a form is a class like any other ordinary class. Say you have a textbox named text1 which is declared as public within your class Form1 and you use it for letting users write down their username. Then to send its value to a different class, named AnotherClass, from within class Form1 (which is the current form) you could say something like:
AnotherClass myClass = new AnotherClass();
myClass.userName = this.text1.text;
OR
AnotherClass myClass = new AnotherClass(this.text1.text);
Hope this helps
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
i need to store some variables withing one class and that class to be accessible all over my application with the specified common variables as the following
i need when i press button to take the text value from the textbox.text and store that value in global variable within a class which i will use in different forms within the same application .
In addition i tried alot but each time when i declare my class as the following
globalclass myclass = new globalclass();
this.username = myclass.username;
it gives me blank variable in username string
i guess that because i open new instance of that class
but i need to store variables and to be called whenever i want within my application with the variables stored in its places
Any help with that
Thanks .
Miss With The Best And Die Like The Rest
|
|
|
|
|
snouto wrote:
i need when i press button to take the text value from the textbox.text and store that value in global variable
I can't figure out what exactly you are doing wrong here. If you create a class with public variables or, even better, public properties, you shouldn't have problem using it across your forms and application. All you have to do is to create an object of that class and pass those members of it that you need to work with (or the whole object if you need it), as arguments to different classes across your application.
snouto wrote:
In addition i tried alot but each time when i declare my class as the following
globalclass myclass = new globalclass();
this.username = myclass.username;
it gives me blank variable in username string
What value do you initialize the username variable with? Also, what is this.username for? Do you wish to refer to a textbox on the form?
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
my friend i need to store the text box value into
the form username string which i declared in the class of the main form i need that username to be stored in the global class to be accessible with the value of the variable all over my application in different forms
Globalclass myclass = new Globalclass();
myclass.username = textbox.text;
and that myclass.username can be accessed from the globalclass in another form
Miss With The Best And Die Like The Rest
|
|
|
|
|
Ok, so what you are saying is that no matter what you type into the textbox, all you keep getting copied into myClass.Username is an empty string? In what event did you place this code?
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
please add me to your contact list
my email address is
matrix_623@yahoo.com
please add me and chat with me now on yahoo please iam waiting for you my friend
Miss With The Best And Die Like The Rest
|
|
|
|
|
The way to this is to :
Create a new class called GlobalVariables //for example.
And then add static members in it and just do:
//in global .
static string userName = "";
//In your form.
button1_Click()
{
GlobalVariables.userName = this.userName.Text;
}
//And just access it as easy as :
string reciever = GlobalVariables.userName;
without the need to initialize any thing.
|
|
|
|
|
The key to what you need is a concept of "static" members.
static members are those that are shared among all instances of a class and are declared using the static keyword.
You can access these static members by just using the classname of the containing class, instead of the variable name holding an instance for instance members.
You can even initialize these static members in the static class initializer that's executed when the class is first loaded by the CLR.
For example:
class MyGlobals
{
static string UserName;
static DateTime LogonTime;
static MyGlobals()
{
UserName = "Not set";
LogonTime = DateTime.MinValue;
}
} Then you can simply do this:
class MainProgram
{
public static void Main()
{
Console.WriteLine("Username is " + MyGlobals.UserName);
}
} This will give you "Not set" without any previous initialization in your MainProgram class.
Regards,
mav
|
|
|
|
|
Its a common situation.
Everybody is giving you advices like "make this field and property that static".. And its OK. But thinking in global I think you should use "Singleton pattern". That would be the most clear solution.
Best regards
p.p: What you mean with "Miss with the best".. wasn't it "mEss"?
|
|
|
|