I have some web page which display the data by values from the url quertString (like: productId) I want to create link on the homepage to the last product that upload to the site (without using select top 1 ... . order by productId DESC) i want to display the productId in the url address, is there any way to do that?
I have managed to expose the MEX endpoint of my WCF service and I can access it with the address like [URL] (example) and get the WDSL. So no problem there.
However, my WCF test page shows the address wrongly by using the server's name instead of the DNS name. And if I click on the link on the test page it won't work (can't get WSDL).
The WCF test page looks like this:
MyService Service
You have created a service.
To test this service, you will need to create a client and use it to call the service.
[URL]
The WCF service is hosted in IIS6. I would like to have a test page with the correct WSDL address so users can see the WSDL quickly in the browser just by clicking on the WSDL address.
In short: How can I change the MyServerName to inter.mycompany.com on the WCF test page? Can this be specified somewhere in the Web.config?
I am trying to pull entries from a database based on the current users IP Address. Here is what I have so far:
[Code]....
I am receiving the following error: Cannot find either column "Request" or the user-defined function or aggregate "Request.UserHostAddress.ToString", or the name is ambiguous.
Is it possible to do this? Should I try to access this information another way?
How do I obtain the IP address or MAC address or some Unique ID of a device within a mobile app, either client or server side?
We are developing a web application targeting iPhone, BlackBerry and Android, generally device independent, and we are looking for ways to uniquely identify a device for added authentication purpose. Is there a way to uniquely identify a mobile device, regardless of the make and model?
I have a Formview where user is selecting the date and time via dropdown values. I am trying to set the value of the field when the record is being inserted for some reason my database still displays a null value.
Protected Sub FormView1_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles FormView1.ItemInserting CType(FormView1.FindControl("txtActivityDateTime"), TextBox).Text = CType(FormView1.FindControl("ddlMonth"), DropDownList).SelectedValue + "/" + CType(FormView1.FindControl("ddlDay"), DropDownList).SelectedValue + "/" + CType(FormView1.FindControl("ddlYear"), DropDownList).SelectedValue + " " + CType(FormView1.FindControl("ddlHour"), DropDownList).SelectedValue + ":" + CType(FormView1.FindControl("ddlMinute"), DropDownList).SelectedValue + " " + CType(FormView1.FindControl("ddlAMPM"), DropDownList).SelectedValue End Sub
I am inserting a picture into a database, using the following code.
strFileType = Path.GetExtension(filImage.PostedFile.FileName).ToLower(); switch (strFileType) { case ".gif": strMimeType = "image/gif"; break; case ".jpg": case ".jpeg": case ".jpe": strMimeType = "image/jpeg"; break; case ".png": strMimeType = "image/png"; break; } //Store the content length int iDocLength = filImage.PostedFile.ContentLength; byte[] bDocBuffer = new byte[iDocLength]; //Get stream object Stream streamImage; streamImage = filImage.PostedFile.InputStream; streamImage.Read(bDocBuffer, 0, iDocLength); cmPerson.CommandText = "INSERT INTO photos VALUES(@referenceid, @image, @imgtype)"; cmPatient.Parameters.AddWithValue("@referenceid", iPersonID.ToString("000000")); cmPerson.Parameters.AddWithValue("@image", bDocBuffer); cmPerson.Parameters.AddWithValue("@imgtype", strMimeType); cmPerson.ExecuteNonQuery();
If in case that the user, did not browser for a picture, then, I have to use the nopho.jpg that is stored in the images/folder of my web app. How am I be able to do this?
I've got a linq to sql query all set up and for some reason it's trying to insert a value for the primary keys of one of the tables, even though I'm not specifying it at all.
Is there an easier way to insert the values contained in a data table generated in ASP into a SQL table without having to loop through all the rows in the data table and insert individually into the SQL table?
I know that if i use newRow = StronTypeDataTable.NewStrongTypeDataRow();
there is a way that i can add the row to the database using the table adapter and have the ID value of the Row accurately reflect the ID on the data base but i cant seem to figure it out.
I have two ddl'a which i insert into a database inform of a grid. Now i will like to make sure the two data i am inserting is not already on the databse and if it exist i want a message to show. I dont have anything right now. I just need ideas on how to go about it.
I am attempting to insert into two tables at once, but it's inserting blank values into the first table, and then correctly inserting the values into the second table. here is my codebehind, I can post the rest of my code if needed.
[code]...
Even when I comment out the second insert command, the first one still inserts null values.
Now i got it to work but the bulk copy is inserting the rows twice, instead of once
and i know the table has the correct rows because i can see it in the gridview correctly
I FIXED THIS PART
my program works fine when i run it in debug mode but not when i place it on the server, it doesnt run the stored procedure when i put it on my server.
getting this error message : Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 7: Line 8: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Line 9: UserIdValue.Text = Membership.GetUser().ProviderUserKey.ToString() Line 10: cannotUploadImageMessage.Visible = False Line 11: End Sub
I have a table memberprofile which has firstname. lastname, gender and physicalstatus. I have written repository class for memberprofile like this.
public void SaveMemberProfile(MemberProfile memberProfile) { matrimonyDb.MemberProfiles.InsertOnSubmit(memberProfile); matrimonyDb.SubmitChanges(); }
[Code]....
now if i click the submit button firstname, lastname, gender ARE getting inserte in to the table. only radiobutton value is not inserting it is showing null value.