Hi all, I need help
I have a IE toolbar menu button: Generate
My flow is
After i click the Generate button, the link on my current website will appear in a:
Form1 > textBoxWebPageURL
Form the Form1.Designer.cs
this.textBoxWebPageURL.Location = new System.Drawing.Point(238, 13);
this.textBoxWebPageURL.Name = "textBoxWebPageURL";
this.textBoxWebPageURL.Size = new System.Drawing.Size(328, 20);
this.textBoxWebPageURL.TabIndex = 5;
this.textBoxWebPageURL.Text = "http://www.codeproject.com"; <-- Whereby i have to hardcode it
How do i make it auto capture the current website that i am browsing and the textbox will display the current website ?
it seems to be a serious problem. I would like to thank all peoples who read the thread and thinking about it. I have solved this issue with a VB.DLL I wrote and call in C#. If you have another suggestion please post.
i'm looking for some tips and tricks about how to insert into relational data (Master/Detail) at the same time.
for example, user want to create new Customer, open Customer form to set it's values and insert some Orders for that Customer (which did not inserted into database yet) in Orders section, then save all together at the same time to database.
can anybody help me and has experience for this issue ?
I know this which run these operations under a single transaction, but my problem is that how to insert foreign key (from Customers) in to order record (because new customer has not been inserted yet, hence it does not a valid Primary key). i'm looking for some tips and tricks about this operation.
I think I don't understand exactly what you want/need. Would this help, or am I missing something in your question?
INSERT INTO Customers (CustName) VALUES ('John') -- Id field is identity, and therefore not named in the fieldlist.
DECLARE @custId AS BIGINT
SELECT @custId = @@IDENTITY -- put new custId key into "@custId" var
INSERT INTO ORDER (OrderId, CustomerId) VALUES (1, @custId)
It's good for an employee and an order. You can put as many SQL-statements in there as you want, SQL Server will keep treating them like an atomic operation
Put the start-transaction and the identity-retrieve statements in a string, and concatenate insert-statements for each order. When done, add the commit-transaction statement (or a rollback in case of error) and execute the string.
What you need to do is that after installing the customer. Fetch the customer id..
And then you can make an overloaded method to save an order where you provide the customerid..
And in that method code it in such a way that the customer id given differently is used and not on the table of orders. .
i am adding one custom property to textbox.when i click on this item i need to show one form (like popup window).and this form having one textbox and one button..after entering the text in textbox and click on ok button.i need to display the text in this custom property item..
i have a strange requirement...ie
i have an EXE in the website folder under IIS in server...and
i can access that exe from client thru url...
but i need to run that exe(which is in server) in client thru a dialog based application ie on buttonclick i need to run the exe in client...
what i did is on buttonclick event im trying to run cmd in the background in which im sending the parameters--> iexplore http://machinename/websitename/my.exe" when i run this im able to run the exe in client but IE browser is opening ....i do"nt want to display IE browser but the exe should run...(if this is not a better way pls let me know how can i run exe from server in client or i need to copy exe from server and paste in client and i run the exe without using server login credentials...)...
Using the following code you can download the exe in a local folder and then execute it:
// remoteExe is the url of the exe on the server (http://machinename/websitename/my.exe)
// localExe is the path where you want to save it locally
System.Net.WebRequest request = System.Net.WebRequest.Create(remoteExe);
// you may need to pass network credentials here, search WebRequest in MSDN for details
using (System.Net.WebResponse response = request.GetResponse())
using (System.IO.Stream stream = response.GetResponseStream())
byte content = new byte[response.ContentLength];
stream.Read(content, 0, content.Length);
// executing the saved exe, if you need you can pass additional parameters here