|
In VB you can do this but not C#. I had a search around and found this[^] which gives this functionality - pretty interesting.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
|
Blue_Boy wrote: Correct code:
Not really.
Blue_Boy wrote: case iGrade>90:
You can't do like that. The value in the case label has to be constant, and of the same type as the value in the switch.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Sorry but someone else had post unhelped this answer, I didn't post by myself.
Sure I will delete it.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
If you don't know C#, always compile your answer before giving it. This won't build.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Sorry but someone else had post unhelped this answer, I didn't post by myself.
Sure I will delete it
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
|
Sorry but someone else had post unhelped this answer, I didn't post by myself.
sure I will delete it.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
KMAROIS wrote: case >; 80:
is this a new syntax introduced in C#?
|
|
|
|
|
I'm exporting data from a datagrid to an excel spreadsheet.I want the spreadsheet to open and display the data when the data is exported(when you click button export).How do i go about making that happen.Please help
|
|
|
|
|
Twyce wrote: I want the spreadsheet to open and display the data when the data is exported(when you click button export).
Once you export the data and file has been written, open the Excel application passing the recently written file name.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hi,
can you please tell how you are exporting data from datagrid?
I need it urgently.
I donot have MS office installed on server
|
|
|
|
|
Im trying to create a crystal report with a subreport.. for every line that display on the main report there will be a subreport and the subreport uses a value from the line that has been displayed as its parameter.. can anyone please help with this? i created a dataset that has a datatable, i fill the dataset and point this to the subreport like this(am not sure if this is right):
SqlDataAdapter subReportAdapter = new SqlDataAdapter(query, connString);
DataSet2 ds2 = new DataSet2();
subReportAdapter .Fill(ds2, "BookedTimes");
venueReport.Subreports["TimesSubReport"].SetDataSource(ds2);
It just throws an error in runtime saying "Invalid argument provided".
|
|
|
|
|
any one has an example on how to override the style of the splitter on windows form using c#?
I want to have something like MS Outlook or Windows Vistal Explorer splitter?
|
|
|
|
|
|
Hi,
I have to install a driver msi-package (B.msi) in the installation of my application (A.msi). But it is not possible to install an msi while an other msi is running. Is there a way to start installation B.msi after the installation of A.msi, if the user doubleclicks only A.msi?
Thanks!
Ariadne
|
|
|
|
|
Ariadne wrote: Is there a way to start installation B.msi after the installation of A.msi, if the user doubleclicks only A.msi?
What about using a batch file that will run A.msi first and after that B.msi
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Manas Bhardwaj wrote: What about using a batch file
not bad, but there are customers, who do not look. If they see an msi-file, they click on it.
(The driver msi B.msi is part of A.msi, it is deployed after A.msi starts.)
I thing, I have to spawn a task in A.msi, which starts after A.msi has completed. - But how?
Ariadne
|
|
|
|
|
|
Go through a tutorial on the Web. They're free.
|
|
|
|
|
|
Hi guys. I hope somebody can help me here. I am reading a file and checking a Database if the record exists, if the records exists I am updating the database with some other information. Now, this was working a few days ago but for strange reason it is not working now. Can somebody please have a look at the below?
foreach (GrpCombi grp in res)
{
dataTable.Clear();
dataAdapter = new OleDbDataAdapter("Select * From [Analysis] WHERE HOLDER_IDENTIFIER = '" + grp.AccountNo + "'", conn);
OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(dataAdapter);
dataAdapter.Fill(dataTable);
if (dataTable.Rows.Count != 0)
{
MessageBox.Show(dataTable.Rows[rowPos]["HOLDER_IDENTIFIER"].ToString());
dataTable.Rows[rowPos]["SapoBal"] = grp.AccountBal.TrimStart(myChar);
dataAdapter.Update(dataTable);
progressBar1.Invoke(new updatebar(this.UpdateGroupProgress));
}
else
{
sw.WriteLine(grp.AccountNo + "," + grp.AccountBal);
}
The error I am getting is on the line dataAdapter.Update(dataTable); . The error message reads as follows:
System.InvalidOperationException was unhandled<br />
Message="Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."<br />
Source="System.Data"<br />
StackTrace:<br />
at System.Data.Common.DbDataAdapter.UpdatingRowStatusErrors(RowUpdatingEventArgs rowUpdatedEvent, DataRow dataRow)<br />
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)<br />
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)<br />
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)<br />
at SasolDataAnalysis.Form1.GroupImport() in C:\Documents and Settings\Bernard\My Documents\Visual Studio 2005\Projects\SasolDataAnalysis\SasolDataAnalysis\Form1.cs:line 233<br />
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
at System.Threading.ThreadHelper.ThreadStart()<br />
I added a message box to capture the record if it is found, which it does but when it does the updating it fails. Any hel;p would be greatly appreciated.
Cheers
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Have you specified in the database table that the HOLDER_IDENTIFIER is the primary key?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
No. But the table does not have a primary key. Could that be the p[roblem?? That it doesn't have a primary key??
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Kwagga wrote: No. But the table does not have a primary key. Could that be the p[roblem?? That it doesn't have a primary key??
Yes. It doesn't know what to put in the where clause to identify the record to update if there is no key.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|