| | |
Another Question
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jul 2007
Posts: 276
Reputation:
Solved Threads: 37
ok, I'm asking another question now....
Previously I had code to add the requester and asignee emails, if the are both empty then I need to build the list. Here is my code:
private string BuildUserList(int p_intSendToRoleID) gives me an error at string and
DataSet dstUsers = new DataSet(); gives me an error at DataSet()
both errors are:"Expected class, delegate, enum, interface, or struct"
and I get "Type or namespace definition, or end-of-file expected" at the last bracket.
I'm stuck again - can anyone help me understand?
Previously I had code to add the requester and asignee emails, if the are both empty then I need to build the list. Here is my code:
C# Syntax (Toggle Plain Text)
private string BuildUserList(int p_intSendToRoleID) { DataSet dstUsers = new DataSet(); DataRow drwData = default(DataRow); string strUserList = null; try { dstUsers = User.GetUsersByRole(p_intSendToRoleID); foreach ( drwData in dstUsers.Tables(0).Rows) { strUserList += (string)(Information.IsDBNull(drwData("Email")) ? "" : Convert.ToString(drwData("Email")) + ";"); } return strUserList; } catch (Exception ex) { throw; } }
private string BuildUserList(int p_intSendToRoleID) gives me an error at string and
DataSet dstUsers = new DataSet(); gives me an error at DataSet()
both errors are:"Expected class, delegate, enum, interface, or struct"
and I get "Type or namespace definition, or end-of-file expected" at the last bracket.
I'm stuck again - can anyone help me understand?
•
•
Join Date: Jul 2007
Posts: 276
Reputation:
Solved Threads: 37
scru - I sent you the entire class in pm I don't normally do that but explain why in the message. . .
ddanbe,
it's probably me - I've used VB.Net at work but we are switching to C# and I have to get better at the differences.
In VB.Net I had
it filled the dataset when calling the User class . . .
will C# not fill it with:
dstUsers = User.GetUsersByRole(p_intSendToRoleID);
ddanbe,
it's probably me - I've used VB.Net at work but we are switching to C# and I have to get better at the differences.
In VB.Net I had
C# Syntax (Toggle Plain Text)
Private Function BuildUserList(ByVal p_intSendToRoleID As Integer) As String Dim dstUsers As New DataSet Dim drwData As DataRow Dim strUserList As String Try dstUsers = User.GetUsersByRole(p_intSendToRoleID) For Each drwData In dstUsers.Tables(0).Rows strUserList &= CStr(IIf(IsDBNull(drwData("Email")), "", Convert.ToString(drwData("Email")) & ";")) Next Return strUserList Catch ex As Exception Throw End Try End Function
it filled the dataset when calling the User class . . .
will C# not fill it with:
dstUsers = User.GetUsersByRole(p_intSendToRoleID);
Last edited by rapture; Oct 20th, 2008 at 4:08 pm.
In the above post I obviously had some trouble on my own.
Look at this website
http://www.ironspeed.com/Designer/5....terface_or.htm
It might help.
Look at this website
http://www.ironspeed.com/Designer/5....terface_or.htm
It might help.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
![]() |
Similar Threads
- C command-line I/O question (C++)
- Apache Alias Directive... mod_alias question (Linux Servers and Apache)
- Completely new to C++ and have question about using char (C++)
- Question (Geeks' Lounge)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the C# Forum
- Previous Thread: Question
- Next Thread: C# COM ports in Linux
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access algorithm array barchart bitmap box buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






