|
I believe the correct syntax is:
List(Nullable(Of Double))
You should probably do some reading on nullable types before you go into this. There are plenty of articles out there.
Ben
|
|
|
|
|
As per your reply, I have used List(of nullable(of double)replacing arraylist. The reason I am asking about collection is a different case, because Chart FX datasource allow either arraylist or collection. if you give me declaration (example) for "collection" object of generic type that would be very halp full.
Thanks
Abdul
|
|
|
|
|
You should use Option Strict On , then the compiler would tell you what the problem is. Actually, that should be part of the company standard, rather than restricting the classes to use.
Compiling the line
lst.add(arrlst(i)) with Option Strict On will give you the error message that implicit conversion from Object to Double is not allowed. With Option Strict Off , the compiler will turn the line into:
lst.add(Convert.ToDouble(arrlst(i))) which explains why it turns your null value (Nothing) into a zero. Calling Convert.ToDouble with a null reference does actually return zero.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for your timely explanation. In another case I am binding arraylist as chart fx datasource, As i have to remove all arraylist from my application(as per my company new standards). the only choice I have is binding a collection of generic type like double, string.
So please give a small example or declaration part for building a collection of generic type.
Thanks in advance.
Abdul
|
|
|
|
|
I'm trying to update a drop down list (DropDownList2) after selecting an item from another drop down list (DropDownList1). Both are set to autopostback. I've set the update panel to both conditional and always with the same result. Nothing happens. However, it works without the update panel. So I suppose that is the source of my problem..
Please help me.
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection QADatabase = new SqlConnection();
QADatabase.ConnectionString = SqlDataSource1.ConnectionString;
QADatabase.Open();
SqlCommand command = new SqlCommand("SELECT Machines FROM Machines WHERE DeptID=" + DropDownList1.SelectedIndex ,QADatabase);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
DropDownList2.Items.Add((string)reader["Machines"]);
UpdatePanel1.Update();
}
QADatabase.Close();
}
|
|
|
|
|
Clearly there are a couple of things wrong with your code. First you don't clear out the dropdownlist2 before the while statement. If you don't do this you will continue to add new items to your dropdown everytime. Second are you sure you select command is returning any rows. I am guessing it is not since you are setting the deptID = to the selectedIndex. I think you would want to set it to the SelectedValue, assuming you set up this dropdown with the selected value containing the deptid.
Hope that helps.
Ben
|
|
|
|
|
The SQL statement returns all Machines in the database with deptID = to the selected index. This is what I want, and I've tested by just putting the data into a string while debugging and it returns the correct values. It returns the correct values when not using the UpdatePanel. It just reloads the entire page. I just haven't implemented the UpdatePanel right.. (P.s I added code to clear the list, thanks for noticing that.)
|
|
|
|
|
|
Thanks Ben. I wasn't adding all of my controls and my data source to the update panel. Just the output control. I added the rest of the related controls and my data source and it updated correctly.
|
|
|
|
|
Glad you figured it out.
Ben
|
|
|
|
|
can you plz help me I have an iframe that I want to access and refresh from another iframe how can I do that in aspx
BiG RaLpH
|
|
|
|
|
IFrame is a HTML componenet. I has nothing to do with ASP.NET. You can deal this with javascript. Get IFrame object using Javascript, then use src to set the IFrame URL.
Hope this helps
|
|
|
|
|
Hi everyone.
I've been handed a Web application that dynamically loads custom UserControls.
Upon a useraction, clicking a link to a given "page" (UserControl), I instanciate the
control using the Page.LoadControl method, store it to Session["Control"], and add it to PlaceHolder.Controls.
This seemed to work out perfectly as the control was maintained on the postback and the state was also maintained. But after I started implementing a button eventhandler I noticed that the event is never caught when the button is clicked and the control refreshes.
I'm not that familiar with Asp.Net as I usually work with windows applications and services.
Could anyone please point me in the right direction of how to avoid loosing the event in the postback?
Best regards!
-Larantz-
|
|
|
|
|
Hey
First things first - check that the event is wired up correctly - think off the top of my head this is done in oninit or some other initialisation function within the page:
http://msdn2.microsoft.com/en-us/library/ms743596.aspx
If this doesnt fix it then make sure that ISS is using the correct version of .NET. If this doesnt work then google asp.net event not firing as there is loads of help (I had this problem too) - i cant remember how i changed the version of .NET but it is in the properties.
Hope this helps
Dan
|
|
|
|
|
i have a date .can i convert the month into monthname
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Call the ToString(String) method on your DateTime structure, passing in a format string of "MMMM".
Paul Marfleet
|
|
|
|
|
ThanQ
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
hi,
I have taken two file upload control (fileUpload1 and fileUpload2) and two required field validator(requiredFieldValidator1 and requiredFieldValidator2) for the two upload controls mentioned above.i.e requiredFieldValidator1 for fileUpload1 and requiredFieldValidator2 for fileUpload2.Now there are two button btnUpload1 and btnUpload2 for two controls.i.e btnUpload1 is for uploading file of name given to fileUpload1 control and btnUpload2 is for uploading file of the name given to fileUpload2.Now what is happening is that when i gave valid file name in fileUpload1 and clicked btnUpload1, it also checks for fileUpload2 and depending on its container, it is throwing exceptions.Like if fileUpload2 has file name given, no error but when there is no file name given in fileUpload2, it is giving error.However, the requiredFieldValidator1 shouldn't check for fileUpload2.The control to validate for requiredFieldValidator1 is fileUpload1 and for requiredFieldValidator2 is fileUpload2. And the same error comes when i try to upload the file of fileUpload2 and click btnUpload2.Well i am using ASP DOT NET 2005 using C# . But when i use only one Required Field Validator, it works fairly..Why this error is coming when using two Required Field Validator...How to solve this ...
suchitamanandhar@hotmail.com
|
|
|
|
|
You could use a CustomValidator control instead. Write your own client-side validation function in JavaScript and link it to the control by setting its ClientValidationFunction[^] property. Your function should incorporate some logic that checks which button has been clicked and only performs validation for the FileUpload control associated with this button.
Paul Marfleet
|
|
|
|
|
Hi,
Thanx for you response....
I didn't understand about linking javascript link to the control...Can you give me the step by step process for that...Actually how the javascript should be ?? And how to return values ?? Can you please explain this in even more simple way ???
Regards,
Suchita
suchitamanandhar@hotmail.com
|
|
|
|
|
You need to Set Validationgroup Property of the control.
set FileUploadControl1,ReuiredFieldValidator1 and Button1 as "Group1" and FileUploadControl2,ReuiredFieldValidator2 and Button2 as "Group2"
Best Regard
Pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hello Pathan,
Thanx for your quick response .Ya, i have tried setting validationgroup property like the one you have suggested ..But it also doesn't work.No any affects shown by the required field validator.The same problem is coming ....So any more methods to implements???Any idea ??Hope to hear from you soon....
Regards,
Suchita
-- modified at 1:46 Wednesday 3rd October, 2007
suchitamanandhar@hotmail.com
|
|
|
|
|
hi all
when i use Asp configuration site to create user or group there is a database created in my site
in this path App_Data>>ASPNETDB.MDF
can i put this database in my sql server not in the site in the previous path
because i want to use and link user with some action in my application
thaks all
Kareem Elhosseny
|
|
|
|
|
i want to display google search results in asp page.here i displayed google results by using html,java script.but i run another result display time also displays.
so plz send code in c# to display google results in our page
venkat
|
|
|
|
|
Well, all you need to do is form a google search URL including the search terms and pass it to your browser.
venky456 wrote: but i run another result display time also displays.
I can't work out what this bit means ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|