|
|
hi
i want to add installer class to my setup.
do any one have good example for that. iwant to call rollback event when condition fails . pls give me some guidence on installer class
i am using .netframework 2.0 vs 2005
with regards
Balagurunathan.B
|
|
|
|
|
How can we send a POST request to some server in code. I actually want to redirect users to some page and send some parameters to that page using the POST method . How can I do this in code ??
|
|
|
|
|
|
I want to do this on the server side . The XMLHttpRequest class is for sending request to server from client and getting the results back . I just want to redirect the user to the page and send some parameters using POST method . Can you elaborate how ?
|
|
|
|
|
|
Hi All,
I am a beginner for .Net technologies. I have few problems in adding dynamic row in grid view.
Please take a look at my code snippet. I have GridView which is populated by a table from database.
I want to give "ADD NEW INFO" option to the user. Following code really works sometime or It just duplicate the available rows and lists in the view.
and my OnUpdateClick is never triggered When it worked. Please help me. I welcome all suggestions
Thanks in Advance.
protected void btnBook_Click(object sender, EventArgs e)
{
GridViewRow newRow = new GridViewRow(-1,-1, DataControlRowType.DataRow, DataControlRowState.Normal);
newRow.Cells.AddRange(CreateCell());
Table tbl = GridView1.FooterRow.Parent as Table;
tbl.Rows.AddAt(GridView1.Rows.Count+1, newRow);
//TableCell cell = new TableCell();
//cell.Controls.Add(new LiteralControl("Footer Row"));
//newRow.Cells.Add(cell);
newRow.ID = "Dynamically Generated Row";
}
private TableCell[] CreateCell()
{
DataSet ds = (DataSet)Session["libDS"];
DataTable dsTable= ds.Tables["libBooks"];
int nRow = dsTable.Rows.Count + 100;
string row = nRow.ToString();
TableCell[] cells = new TableCell[5];
TableCell cell = new TableCell();
TextBox txt1 = new TextBox();
txt1.Text = row;
txt1.ReadOnly = true;
cell.Controls.Add(txt1);
cells[0] = cell;
cell = new TableCell();
txt1 = new TextBox();
txt1.Text ="";
cell.Controls.Add(txt1);
cells[1] = cell;
cell = new TableCell();
txt1 = new TextBox();
txt1.Text ="";
cell.Controls.Add(txt1);
cells[2] = cell;
cell = new TableCell();
txt1 = new TextBox();
txt1.Text ="";
cell.Controls.Add(txt1);
cells[3] = cell;
cell = new TableCell();
LinkButton link1 = new LinkButton();
link1.Text = "Update";
link1.Click += new EventHandler(OnUpdateClicked) ;
cell.Controls.Add(link1);
link1 = new LinkButton();
link1.Text = "Cancel";
link1.Click += new EventHandler(OnCancelClicked);
cell.Controls.Add(link1);
//link1 = new LinkButton();
//link1.Text = "Cancel";
//link1.OnClientClick ="OnUpdateClicked(false)";
cells[4] = cell;
return cells;
}
|
|
|
|
|
Hey all,
I was wondering if there was a way for the WebBrowser Control to detect when a link is opening a new window, i.e. using:
Open a new window!
Any help would be appreciated!
Thanks!
Sean
|
|
|
|
|
If i select Datemotnyear from datetimepicker i need display the day as mondayor Tuesday
How To display?
|
|
|
|
|
myDateTimePicker.Value.DayOfWeek.ToString()
or
myDateTimePicker.Value.ToString("ddd")
or
myDateTimePicker.Value.ToString("ddddddddddd")
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
How can i build a messenger in .net? with id and password stored in server
|
|
|
|
|
Decide how to store the ID and password. Write the code to access the IDs and passwords.
Decide the transport method and protocol for the messenging. Write the code to use that transport methd and protocol.
If you want more details there are plenty of tutorials you can search for on google.
If you have any specific problems, rather than generals ones then just ask and we'll be happy to help.
|
|
|
|
|
Hi Guys
Is there a place in visual studio to select which version of the framework you'd like to use for a specific project?
|
|
|
|
|
Studio 2003 targets 1.1 only
Studio 2005 targets 2.0 only (and 3.x which are just extensions)
AFAIK Orcas lets you choose exactly which >=2.0 you will target
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: AFAIK Orcas lets you choose exactly which >=2.0 you will target
Yes, that is the case. The default for new projects is .NET Framework 3.5, but you can change it as needed to 3.0 or 2.0.
|
|
|
|
|
Not until Visual Studio 2008 is released, unless you want to use the Beta 2 release.
Visual Studio Version .NET Framework Version
--------------------------------------------------------------------
Visual Studio.NET 1.0
Visual Studio 2003 1.1
Visual Studio 2005 2.0
Visual Studio 2005 with .NET 3.0 Extensions 3.0
Visual Studio 2008 3.5, 3.0, 2.0
-----------------------------
In just two days, tomorrow will be yesterday.
http://geekswithblogs.net/sdorman
|
|
|
|
|
Thanks for the info guys. I found what I was looking for under
Project -> Properties -> Build -> Change Button
|
|
|
|
|
Visual Studio 2005 has a Version Selector component right?
|
|
|
|
|
I was running one of my assemblies through FxCop and got this message:
"As it is declared in your code, parameter 'handle' of PInvoke NativeMethods.waveOutGetVolume(Int32, Int32&):Int32 will be 4 bytes wide on 64-bit platforms. This is not correct, as the actual native declaration of this API indicates it should be 8 bytes wide on 64-bit platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of 'System.Int32'."
I've been looking at MSDN and haven't found anything yet specific to this problem. Still looking. But I thought I'd go ahead and ask here. How do you declare your interop methods so that they work correctly on both 32-bit and 64-bit systems?
|
|
|
|
|
Use IntPtr in place of Int32.
|
|
|
|
|
Abisodun wrote: Use IntPtr in place of Int32.
But does this mean having to allocate unmanaged memory for the pointer?
If I do this:
IntPtr handle = new IntPtr();
int result = waveOutOpen(handle, deviceID, ref format, 0, 0, CALLBACK_NULL);
waveOutOpen returns an error.
If I have to allocate unmanaged memory for the pointer (ugh), how do I tell how much to allocate? On a 32-bit system it will be 4 bytes. On a 64-bit system it will be 8 bytes.
[EDIT]
Nevermind. I discovered that I need to declare my interop method like this:
[DllImport("winmm.dll")]
public static extern int waveOutOpen(out IntPtr handle, int deviceID, ref WaveFormat format,
int dummy, int instance, int flags);
The key is to use the out modifier on the IntPtr parameter.
Thanks for your help.
[/EDIT]
-- modified at 13:34 Friday 17th August, 2007
|
|
|
|
|
The size of IntPtr changes depending on the proc. So, an IntPtr on a 32-bit system is 32-bits wide and on a 64-bit system is 64-bits wide, automatically.
You don't have to allocate anything. You're just using the pointer as a self-sizing integer.
IntPtr handle = IntPtr.Zero;
|
|
|
|
|
Dave Kreskowiak wrote: The size of IntPtr changes depending on the proc. So, an IntPtr on a 32-bit system is 32-bits wide and on a 64-bit system is 64-bits wide, automatically.
You don't have al allocate anything. You're just using the pointer as a self-sizing integer.
Understood. I think I was running into problems when I tried switching to IntPtr because I was using the ref modifier on the IntPtr parameter instead of out .
Thanks for your help.
|
|
|
|
|
Hi Leslie,
here is my theory (still theory since I have not run any of this on Win64):
- for native pointers you really should use IntPtr, and it is not hard to do so.
- Win32 uses 4B pointers, Win64 needs 8B pointers
- you must build for either 32-bit or 64-bit
- on Win64 everything must be consistent (all modules 64-bit is fine, and
all modules 32-bit runs in some compatibility mode, not sure tho)
- IntPtr is a value type that holds either 4B or 8B pointer value
- IntPtr must be initialized, normally you give its value at construction
- a lot of P/Invoke examples are wrong, and use int/uint where it should have
been IntPtr. Most notably SendMessage: lParam, wParam and return value should
be regarded as IntPtr, and cast to int or whatever if and when appropriate.
- correct prototypes would have IntPtr for anything that is or could be a handle
(such as lParam).
Your problem seems to be you did not initialize handle.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: here is my theory (still theory since I have not run any of this on Win64):
- for native pointers you really should use IntPtr, and it is not hard to do so.
- Win32 uses 4B pointers, Win64 needs 8B pointers
- you must build for either 32-bit or 64-bit
- on Win64 everything must be consistent (all modules 64-bit is fine, and
all modules 32-bit runs in some compatibility mode, not sure tho)
- IntPtr is a value type that holds either 4B or 8B pointer value
- IntPtr must be initialized, normally you give its value at construction
- a lot of P/Invoke examples are wrong, and use int/uint where it should have
been IntPtr. Most notably SendMessage: lParam, wParam and return value should
be regarded as IntPtr, and cast to int or whatever if and when appropriate.
- correct prototypes would have IntPtr for anything that is or could be a handle
(such as lParam).
Thanks for this explanation.
I've got a lot of code revision to do. I have older "toolkits" whose P/Invoke methods are apparently wrong, or will at least break on a 64-bit system.
Luc Pattyn wrote: Your problem seems to be you did not initialize handle.
Actually, I don't think I'm suppose to initialize the handle, rather I should use the out modifier on the IntPtr parameters rather than ref , as I had initially tried.
|
|
|
|