|
SOLVED,
I never see .Verticalscroll.Value before
|
|
|
|
|
hi,
i want to know how C# pass collection type method......wanna to knw C# code for this!
Public Shared Function GetQuestionIDsForSurvey(ByVal id As Integer) As Collection<br />
Try<br />
Dim dsQuestions As DataSet = GetQuestionsForSurvey(id)
Dim dtQuestions As DataTable = dsQuestions.Tables(0)<br />
Dim mQuestionCollection As New Collection<br />
For Each dr As DataRow In dtQuestions.Rows<br />
mQuestionCollection.Add(dr.Item("ID").ToString())<br />
Next<br />
Return mQuestionCollection<br />
Catch ex As Exception<br />
Throw<br />
End Try<br />
End Function
Thanks in Advance!
|
|
|
|
|
I don't understand what you want to know exactly, but here's the C# version of your code snippet generated with http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx[^]:
public static Collection GetQuestionIDsForSurvey(int id)
{
try {
DataSet dsQuestions = GetQuestionsForSurvey(id);
DataTable dtQuestions = dsQuestions.Tables(0);
Collection mQuestionCollection = new Collection();
foreach (DataRow dr in dtQuestions.Rows) {
mQuestionCollection.Add(dr.Item("ID").ToString());
}
return mQuestionCollection;
}
catch (Exception ex) {
throw;
}
}
|
|
|
|
|
hi chopeen,
Thnkz lot for ur effort! but there were errors in ur code also like,
Tables(0),Item("ID")......so on..!
hey actually i want to know which namespace provide Collection class or is it the actual usual way using that something like Collection<t> ,,any Enumarable type..........
the thing is i am not having idea off using these techniques,...
plz give some resources also.........!
|
|
|
|
|
|
You're right. I did not check the code and I forgot that this converter cannot tell a method call from an indexer - it should be Tables[0], Item["ID"], etc.
|
|
|
|
|
The Collection class is in the Microsoft.VisualBasic namespace. It's an untyped list, pretty much like ArrayList .
Use List<string> instead.
If you absolutely have to use the Collection class, add a reference to Microsoft.VisualBasic.dll , and use Microsoft.VisualBasic.Collection .
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi Guffa,
Thankz lot!wow, thats was de thing i want.......Excellant!
thankz everybuddy who tried to solve my problem! Good Luck!
Have a nice Day!
|
|
|
|
|
I have two questions I hope you can help with.
How can I display my combobox display default to blank when I have a bound data source. (I need it that way).
I have tried combobox.selectedIndex = -1 but doesn't work.
Have also added the column of blank manually like this
DataRow newemployeesRow = dataSet1.Tables["employees"].NewRow();
newemployeesRow["Fullname"] = "";
newemployeesRow["Fullname"] = -1;
dataSet1.Tables["employees"].Rows.Add(newemployeesRow);
It shows a column of -1 in my combobox but it is not set to the default though. the user has to select it. If I remove the combobox.selectedIndex = -1 it displays blank which I want, but it's still not the default.
Can someone please help.
|
|
|
|
|
newemployeesRow["Fullname"] = "";
newemployeesRow["Fullname"] = -1;
dataSet1.Tables["employees"].Rows.Add(newemployeesRow);
after this try by using this code.
dataSet1.AcceptChanges();
VanithaVasu
|
|
|
|
|
This unfortunately does the same thing as before. It displays -1 in the list instead of a blank, and isn't set as the default anyway.
ahhhh
|
|
|
|
|
hii
at starting u asked that u wanna have blank in the combox fro default. whaen u remove combobox.selectedIndex=-1 from code u get that then what do u mean by it's not default!
please clear the point
Thanks
Avinob Roy
|
|
|
|
|
I worked it out thanks.
|
|
|
|
|
Hi
I would like to know How to Embedd Winform Tracker control in Infragistics Ultragrid?
Could you please provide source code or some hint on smae. Many thanks in advance.
|
|
|
|
|
in vb i knew Isdate funciton to check the date is valid or not.
What is the syntax in c#
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
DateTime.TryParse ? What is the date coming in as that you need to check, a string ?
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 )
|
|
|
|
|
The textbox contains date.So wanted to check , whether the date is valid or not.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Do what Christian said - DateTime.TryParse() . Be careful about the culture though!
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
hi all.i use gdipsaveImageTofile(intptr ,filename, ref clsid,intptr.zero),for save image with 300dpi,but that save image with 96dpi i can't solve this problem plz help me.
|
|
|
|
|
Goodness knows what you're using, but the DPI settng is just metadata, it's meaningless to image quality unless you're using WPF.
You're using a p/invoked API ?
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 )
|
|
|
|
|
first i created a new file of .cs type
there in the namespace i wrote the following code.
internal class Class1
{
public int a;
}
then in the program.cs file i created an instance of the file
static void Main()
{
Class1 d = new Class1();
}
Should not this had created an error , while creating an instance of class1
because it is accessible only within the assembly.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Are the two files in different assemblies? I think you created them in the same project.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
program.cs creates itself after the new program creation.and i created one file named class1.now both are in same project.
I wanted to ask that if In the same project internal members are accessbile in the derived classes and also i can create the instance of the instrnal class , one more thing , internal members are accessible in the instance of the class(eve if the class is declared public).
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: now both are in same project.
Then your classes are in the same assembly, so the internal class is visible to Main (and everywhere else).
Sonia Gupta wrote: I wanted to ask that if In the same project internal members are accessbile in the derived classes
internal members are visible everywhere in the same assembly. It's as simple as that.
Sonia Gupta wrote: internal members are accessible in the instance of the class(eve if the class is declared public).
From where? Internal members of a public class will be visible in the same assembly. Internal members of a public class will not be visible outside the assembly, even though the class itself will be.
You can try out all of this yourself; it will teach you a lot.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
Hi all,
How do I able to get all the icons and extension of my files in my computer using coding?
is there anyway?
I know is something to do with HKEY_CLASSES_ROOT but I not sure how to code it. is there any sample? thanks.
I wish to take them out and then place it on a treeview. so user can see the all my treeview having diff icons.
|
|
|
|