|
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
|
|
|
|
|
The event is called 'checkedchanged', it's working as advertised. When radio1 unchecks, the check has changed, so the event is called. The object passed into the method is the control that raised the event, so you can use that to check if the control is checked or unchecked ( or when you have one event per control, you can access it directly )
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 )
|
|
|
|
|
|
I don’t find a way to autosize columns i a ListView depending on its contents…
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi,
In regards to your query I would suggest you to try the following code snippet:
The following code example demonstrates initializing a ListView in detail view and automatically resizing the columns using the AutoResizeColumn method. To run this example, paste this code into a Windows Form and call the InitializeResizingListView method from the form's constructor or Load event handler.
-----------------------------------------------------------------------------------------------------
private ListView resizingListView = new ListView();
private Button button1 = new Button();
private void InitializeResizingListView()
{
// Set location and text for button.
button1.Location = new Point(100, 15);
button1.Text = "Resize";
button1.Click += new EventHandler(button1_Click);
// Set the ListView to details view.
resizingListView.View = View.Details;
//Set size, location and populate the ListView.
resizingListView.Size = new Size(200, 100);
resizingListView.Location = new Point(40, 40);
resizingListView.Columns.Add("HeaderSize");
resizingListView.Columns.Add("ColumnContent");
ListViewItem listItem1 = new ListViewItem("Short");
ListViewItem listItem2 = new ListViewItem("Tiny");
listItem1.SubItems.Add(new ListViewItem.ListViewSubItem(
listItem1, "Something longer"));
listItem2.SubItems.Add(new ListViewItem.ListViewSubItem(
listItem2, "Something even longer"));
resizingListView.Items.Add(listItem1);
resizingListView.Items.Add(listItem2);
// Add the ListView and the Button to the form.
this.Controls.Add(resizingListView);
this.Controls.Add(button1);
}
private void button1_Click(object sender, EventArgs e)
{
resizingListView.AutoResizeColumn(0,
ColumnHeaderAutoResizeStyle.HeaderSize);
resizingListView.AutoResizeColumn(1,
ColumnHeaderAutoResizeStyle.ColumnContent);
}
-----------------------------------------------------------------------------------------------------
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Set the ColumnHeader width to -1 or -2 to get autosize according to heading or content.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|