|
So you need to change your GetCustomers to fetch the data from the database and use a datareader. iterate the datareader and create a new Customer class for each dataitem in the reader and fill the appropriate properties. Before your next iteration, add that Customer class to the collection with your Add method. Rinse and Repeat.
thanks for reply
i know this way to get data strongly typed, is there any other way to get data strongly typed ?
however many thanks
regards.
|
|
|
|
|
I have an SqlConnection, what i need is to get the server value and the database value from the connectionstring it contains.
Is there an easy way to get these values, or do I have to resort to using the dreadful regexp?
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
Nvm, solved it ^^
SqlConnectionStringBuilder connstr = new SqlConnectionStringBuilder(ConnectionString);
string server = (string) connstr["server"];
string database = (string)connstr["database"];
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
Dear All,
I am a novice c# programmer, I am astounding seeing following code block
<br />
<br />
public class NewClass<br />
{<br />
public static NewClass Add(parm1,parm2)<br />
{<br />
NewClass newclass = new NewClass();<br />
return newclass; <br />
}<br />
}<br />
<br />
<br />
I want to what logic behind this return type(as class)
What it actually returns? what type is this, I am unware of this.. Any help highly accepted.
|
|
|
|
|
You need to buy a beginners book and work through it for the basics.
You can return any type you like, including types you define.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can we use the DataAdapter method like
if(dAdapter.Upadate(dt) == 1)
MessageBox.Show("Update successful");
->Is Update method alwaya return 1 on successful update ?
->Is this is correct way to use the information that data has been updated?
-> If no, then what can be the possible consequencies ?
Your comments are welcome
|
|
|
|
|
Gee golly gosh, they do have a habbit of hiding this stuff in the documentation[^]
[quote]
Return Value
Type: System..::.Int32
The number of rows successfully updated from the DataTable.
[/quote]
|
|
|
|
|
Hello,
I am searching for a professional windows forms thumbnail component that will display images with the look and feel of the Windows Vista pictures folders or something similar.
Searching on the net I found many asp.net thumbnail components but nothing for windows forms.
Do you now any?
Thanks
|
|
|
|
|
can someone help me with how to calculate the variance and gradient of pixels contained in an image.
tony-yeyo
|
|
|
|
|
I guess you just want to access the pixels, as per my image processing articles, then build a list of how often each value occurs ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ive got a legacy Windows Form Application (framework 1.1).Initally it was built for one person but two more people would like to use it at their desktop. I dont want to install it on there desktop how do i go about sharing his application from one remote location.
|
|
|
|
|
1. Run from a shared folder, remember to setup the trusting of assemblies.
2. Use ClickOnce to deploy to them. (VS2005 only)
By the way, your application handles concurrency, right?
|
|
|
|
|
Yes it does. Thanks Dude!!
|
|
|
|
|
Hello everyone.
I have a little application which accepts an excel file, performs a formal check on it (nothing special, it just tries to see if there's a number or a string where they should be) and then inserts the records in a database.
This application loads the excel file, puts all the data in a datatable, then performs the formal check.
To do so, I use an instance of OleDbDataAdapter and call the Fill(table) method to fill up a table.
What is startling me the most is that with some Excel files, if I erase the last row manually (e.g. in MSExcel, clicking in the cells and pressing DEL), the row is not completely erased, so the datatable resulting from the Fill() operation has one last row empty, which is causing the formal check to fail - thus preventing the file to be loaded, since it works in an all-or-nothing basis (one rows fail, the whole file is discarded).
The thing that is driving my crazy is that this happens only on SOME excel files! Even using the same Excel installation on the very same machine, some files will show this behaviour, some others won't.
Has anything similar ever happened to some of you? I cannot really get a grasp of this.
Thanks in advance
Rey9999
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
Hi, this reminds me of the many problems i've experienced with sql server DTS using excel files as the source. The solution is to ensure there are no blank lines at the bottom of your dataset in the spreadsheet (use Ctrl-End in excel to see if there are any blank lines). you can do this by copying the data to a new worksheet before running your app. Alternatively, you could check each row for blanks as you populate the dataTable.
Rob
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
Thank you.
Indeed, I solved the issue with a "dirty trick": after I've populated the DataTable, I check the last row and erase it if it's blank (I do not need to check them all, because the excel files they give me never have blank lines in between, apart from the last one - and that was actually causing the problem amongst my program's users)
Thanks again!
Rey9999
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
Hi all,
How can I make use of the SortedListand the Control within the foreach loop below:
When I try I get the following exception:
Unable to cast object of type 'System.Collections.DictionaryEntry' to type 'System.Windows.Forms.Control'.
SortedList sorted = new SortedList();
for (int c = (xPPanelAddStock.Controls.Count - 1); c > 0; c--)
{
sorted.Add(xPPanelAddStock.Controls[c].Name, xPPanelAddStock.Controls[c]);
}
foreach (Control stockAddControl in sorted) EXCEPTION OCCURS
{
...
Can anyone please help.
Many thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
|
Hey, me again
You can also do this if you need access to the key value as well:
SortedList<String, Control> myList = new SortedList<string, Control>();
foreach (KeyValuePair<String, Control> pair in myList)
{
String thisIsTheString = pair.Key;
Control thisIsTheControl = pair.Value;
}
Simon
|
|
|
|
|
HI Guys,
Any of you know how to display the barcode images into the crystal report 10.0.
Image path is stored the in MS Access DB......
C# and MS Access
Crystal Report(VS 2005)
Regards
Subash
Subash
|
|
|
|
|
I have Convert the Bound field into Template Field...I had both the Edit Template and the Item Template..But the DataBound Field doesnt convert to Linkbutton..Even I tried the Javascript..
Please help me..
Thanks in Advance
Arun
|
|
|
|
|
Please don't keep posting ASP.NET questions in the C# forum. And, perhaps if you actually posted some code, we could work out your problem ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
using find control as
linkbutton lnkBtn=(linkbutton)gridview.findcontrol("IdOfLinkbutton")
|
|
|
|
|
Hi,
I have 10 radioButtons and when I first time select radioButton1 on GUI everthying works well, I see the method radioButton1_CheckedChanged_1 has been invocked. But after when I select radioButton2 I see first that the radioButton1_CheckedChanged_1 has been invocked an after that radioButton2_CheckedChanged_1 and same behaviour for the rest of radio buttons.
Can somebody help me with the isuue that when I select a radio button then the right radiobutton method is going to be invocked.
Thanks in advanced
mehran
|
|
|
|