i need to check if some parameter exist in Request.Params any one know how to check that? dont use request.params["para"] != or "" i am not try to check if value exist, i need to check if the parameter himself exist before the checking if his not null or empty.
System.ArgumentOutOfRangeException: 'DropDownList' has a SelectedValue which is invalid because it does not exist in the list of items.this question has been for a long time ago but seem no actual answer for it except for catching the exception.I don't want just catch error instead of check first whether the value exist in drop down list. My scenario was different from the other. my data source is bind to a datatable, all is in hard code.
I have detailed view and a grid view, the DetailedView does the inserting into the Grid view. On my table( Ussing SQL Server), i have a username and year and allocation. What do i do so that when an allocation is given to a user for a year that already exit, it refuses.
I am not using any database for data source.I can enter the some value in text box and the entered value is automatically added in the gridview.How can i validate not adding same item numbers in gridview.And i also calculated grand total for amount column.If i remove any records means how to recalculate current total.Any one can tell solution for this issue.I am waiting for reply ASAP.
when click save button,I want to save the textbox values to database table..If the record is already available then just update that value... I have the code for insert and update..but i don't know how to check the already existing record..I need ,check existing record using only auto generated id
I am in a situation that i cant solvecos i am new to VB.net. I have a page with both a Detail and Grid view. The Detalview does the inserting to display it on the grid view. My table(Using SQL Server) has 3 field Username, Month and Allocation. I want to give an allocation to a user, but if the user already has one for that month, i want it to cancel.
I'm trying to make checkboxes check if they exist in a table.
What I'm initially trying to do is to list the values is a table e.g. product types, and then if a product has those types assigned to it mark the check box as checked. e.g.
Products Table
Prod No Prod Name
1 Silver Bag
2 Black Bag
3 Red Hat
Product_Types Table
Prod_Type_No Prod_Type_Name
1 Bag
2 Leather
3 Hat
Associated_Product_Types
Prod_No Prod_Type_No
1 1
1 2
2 1
3 3
So When I select product 1 (Silver Bag) it shows 3 check boxes for the product types and prod type 1 and 2 are checked as they exist in the Associated_Product_Types
My problem is I cant figure out how to mark them as checked based on the values in that table.
Before a subscription to a newsletter and the record will be inserted, i'd like to check if the record already exist ina sql-server database. This what i've got as dusfar
adres = TxtEmail.Text DBConn.Open() If adres <> "" Then Try DBCmd = New SqlCommand("SELECT COUNT(*) FROM TBL_Subscribers WHERE email = @adres)", DBConn) ''Add DBCmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = adres DBCmd.ExecuteScalar() DBAdap = New SqlDataAdapter("SELECT * FROM TBL_Subscribers ORDER BY ActivateDate", DBConn) DBAdap.Fill(DS) Catch exp As Exception Response.Write(exp) End Try End if
string jSFile = ResolveUrl("~/MyProject/JavaScripts/dir/test.js"); if (!System.IO.File.Exists(jSFile)) { ... }
This code doesn't work and I guess it's the jSFile that doesn't work well with the IO.File.Exists but I know the jSFile has a valid path because when I use few line later
i try to fetch the data from the database and display text in the dropdownlist
i got the error message
'cmbslot' has a selectedvalue which is invalid because it does not exist in the list of items parameter name value cmbslot.Text = obj.getdata(dr["slotcode"].ToString()); //here is my code to retrive the data from the database
I've written a singleton class that exposes the web.config properties in a nice get property kind of way.
I want a Load method to parse the data in the config and set the public properties, and I want to throw exceptions (so they are logged in the EventLog) when a configuration key is missing or can't be parsed.
I tried placing the Load() code in Application_Start of the global.asax but then remembered this will only be run once, or until the application restarts.
Where is the best place to put code that you need to run 'everytime' your site is started/run by the user? I basically want the website to stop functioning if certain config properties cannot be loaded.
I have set the value of an int parameter to the attribute of a textbox.The textbox can be empty or null, how to check whether the parameter is empty or null?
I have developed an asp.net application ... I have a textbox where user will enter is name ... I need to check if the name is already exist in the database table column when ever user enter their name with out post back . If user exist mean it should show a msg user already exist .....
I have a GridView on a page for maintainance of the database (mdf). Under this GridView1 I have a FormView1 where I use the ItemInsertTemplate to Insert new rows in my database (which shows the data in GridView1). The first textbox (BIDTextBox) i have on this template, contains text which identify a person. I would like to have a routine which checks if the same value that is entered in the BIDTextBox allready exists in the database. This routine should be fired upon leaving the control BIDTextBox.
I have tried with some stored procedure in my database, but that dosn't seem to do the trick. The most logical to me seems to do a loop thru my table "Ansatte" in my database using sql, selecting any occurence from the field "BID" in my table "Ansatte" that is simillar to the text entered in the BIDTextBox.
I have .Net web application which connects to Oracle 10g database. I want to check for space availibility before creating Indexes. Also if space is not sufficient then I would like to send an Email message to admin. How to do that from .Net web application?
i want to check my collection so i can add a new customer as long as the username does not exist in the collection i do not want 2 customers to be able to have the same username.
i have been trying many different things to try to get this to work but i am not exactly sure what i should be doing I have a aspforum and collection C# class of the list.
here is some things that i have tried
CustomerExists() i also have a collection of List<Customers> //HERE IS MY EXISTS METHOD public static Boolean IfCustomerExists(string login) { List<Customer> theGuy = Collections.Customers; bool exist = false; foreach (Customer customer in theGuy)
I have a form that is HTML, it involves a few string questions, a radio button, and a check box question. After the form is filled out, the info is then passed to an aspx page which sends out an email with the info. I am able to pass the string questions to the email, but am having trouble passing the radio button answer and the check box answers to the aspx and to then to the email. I have the code for the HTML set, I need help with the code for the ASPX page.(it is VB) Here is the code I have so far.
HTML <form id="form" method="post" action="SendEmail.aspx" enctype="multipart/form-data" name="questions"> <div class="Qblock">Name: <input type="text" class="input" value="" name="contact_name" /></div> <div class="Qblock">Phone #: <input type="text" class="input" value="" name="contact_phone" /></div> <div class="Qblock">E-Mail: <input type="text" class="input" value="" name="contact_email" /></div> <div class="Qblock">How many years have you been in this industry?<input type="text" class="input" value="" name="contact_long" /></div> <div class="Qblock">What is your specialty?<input type="text" class="input" value="" name="contact_special" /></div> <div class="Qblock">Do you have a cell phone? <input type="radio" name="P1" value="Yes" /> Yes <input type="radio" name="p1" value="No" /> No <br /></div> <div class="Qblock">Can you do any of the following? (check all that apply)<br /> <input type="checkbox" name="ckBox" value="CustSer" /> Handle Customer Service<br /> <input type="checkbox" name="ckBox" value="ReadForm" /> Read Expense Reports<br /> <input type="checkbox" name="ckBox" value="NewCust" /> Sign Up New Customers<br /></div> ASPX Protected Sub RetrieveValues() Dim sTemp As String = String.Empty sFromName = "[URL]" sToName = "[URL]" sSubject = "Web - Contact Us Inquiry" sTemp = String.Format("{0}{1}{2}", "<<< Marketing Opportunities >>>", vbCrLf, vbCrLf) sTemp = String.Format("{0}{1}{2}{3}", sTemp, "Name: ", Request.Params("contact_name"), vbCrLf) sTemp = String.Format("{0}{1}{2}{3}", sTemp, "Phone: ", Request.Params("contact_phone"), vbCrLf) sTemp = String.Format("{0}{1}{2}{3}", sTemp, "Email: ", Request.Params("contact_email"), vbCrLf) sTemp = String.Format("{0}{1}{2}{3}", sTemp, "How many years have you been in this industry? ", Request.Params("contact_long"), vbCrLf) sTemp = String.Format("{0}{1}{2}{3}", sTemp, "What is your specialty? ", Request.Params("contact_special"), vbCrLf) End Sub