|
well, the program was done in c#. I'm asuming the bug is c# related. I'm not sure, well, because I don't know what's causing it. If someone thinks the problem lies elswere, please let me know.
|
|
|
|
|
I have a program which creates multiple threads. Each thread sends a WebService request.
What I am finding using sniffer is that even if I have 10 threads sending request, all requests are sent from one or two ports. I would like to have each thread use different port to send the WebService request.
Is there any ways to accomplish this?
Thank you for help.
|
|
|
|
|
Hi guys.Im trying to plot Bode graph in C#.Anybody knows where to find any algorithm for that?
|
|
|
|
|
Do you need to know how to calculate the points, or how to draw them ? If the former, google will help. If the latter, you could use SetPixel, or any of the line/shape drawing methods exposed by the Graphics object.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I want to display a simple Crystal Report (already, I think this is an oxymoron) in a Windows Form using a dataset (I'd prefer to do all the database work in my code, rather than letting CR do it).
All of my C# code is using Oracle.DataAccess.Client, but when I tried to create a new DataSet, VS said I had to use the Microsoft Oracle object. I did, created a DataSet with one table, EMPLOYEE. I then created my report that lists four items from the table -- no grouping, no counting, just a list.
Then, I created a Windows Form that gathers the required parameters for my query, and using those parameters, build the SQL. I use the SQL to fill the EMPLOYEE table in the DataSet created earlier. If I look, the table has 700+ rows after filling.
Then, I create a report object, set the datasource to the filled dataset, and set the Crystal Reports Viewer's ReportSource to the report. Seems straightforward, no errors. However, when I try to display the new form (that contains the crystalReportViewer), I am presented with a logon dialog box, asking for server, database, username, password. Even if I supply all of these items, it fails to logon. The form containing the viewer is shown, but there is no report.
I tried filling the dataset with the MS Oracle connection/command/dataadapter, but it made no difference. I also tried setting the username/password for each table in the report after the report object was created, but no luck either.
I read http://support.businessobjects.com/forums/message.asp?fid=251&sk=5&ps=25&pn=1&mid=152400#m152400, and a couple of other articles as well (http://www.codeproject.com/aspnet/crystal_report.asp#xx852522xx, http://aspalliance.com/265, and http://www.dotnetjunkies.com/Article/790775A0-C493-46D8-ABE0-40CA588D33D3.dcik).
Any thoughts on how to make this work, and/or a better place to ask?
DatasetReportPositiveEmployees ds = new DatasetReportPositiveEmployees();
string sSQL = "SELECT DISTINCT empID, empFName, empLName, empAcctNum from Employee " +
"LEFT INNER JOIN TestResult ON empID = testEmployeeID " +
"WHERE (testResult IN (SELECT resultID FROM Result WHERE resultTreatAsPositive=1))";
System.Data.OracleClient.OracleConnection localConn = new System.Data.OracleClient.OracleConnection(settings.ConnectionString);
localConn.Open();
System.Data.OracleClient.OracleCommand localCmd = new System.Data.OracleClient.OracleCommand();
localCmd.Connection = localConn;
localCmd.CommandText = sSQL;
localCmd.CommandType = CommandType.Text;
System.Data.OracleClient.OracleDataAdapter adapter = new System.Data.OracleClient.OracleDataAdapter();
adapter.SelectCommand = localCmd;
adapter.Fill(ds, "EMPLOYEE");
CrystalReportPositiveEmployees report = new CrystalReportPositiveEmployees();
Tried with/without this section
CrystalDecisions.Shared.TableLogOnInfo login = new CrystalDecisions.Shared.TableLogOnInfo();
foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in report.Database.Tables)
{
login = tbl.LogOnInfo;
login.ConnectionInfo.ServerName = "myComputer";
login.ConnectionInfo.UserID = "myUser";
login.ConnectionInfo.Password = "myPass";
tbl.ApplyLogOnInfo(login);
}
report.SetDataSource(ds);
formReportViewer dlg = new formReportViewer();
dlg.crystalReportViewer1.ReportSource = report;
dlg.ShowDialog();
Thanks,
Glenn
|
|
|
|
|
Hi
I've been doing some diggin in the uxTheme.dll, and have managed to some stuff, but now I need to get mu buttons to look as the taskbar buttons, maybe the quicklaunch buttons. Yet I've looked all arround this file, and can't find them. I've used tools like this http://www.codeproject.com/managedcpp/ManagedUxTheme.asp to see the resources, but nothing.
can anyone help?
Thanks
|
|
|
|
|
I have wrote an article at this website on transparent menus and system-titlebar buttons. This article goes into detail on how to use UxTheme dll to paint titlebar buttons on a form using Visual Styles. This may be part of what you need to find what you are looking for.
Regards,
1tg46
Check out 3D Game Development with Dark Basic Professional [^]programming.
|
|
|
|
|
hi all i want to save images to database. I use this code
private int SaveToDB(string imgName, byte[] imgbin, string imgcontenttype)
{
//use the web.config to store the connection string
MySqlConnection connection = new MySqlConnection(ConfigurationSettings.AppSettings["DSN"]);
MySqlCommand command = new MySqlCommand( "INSERT INTO Image (img_name,img_data,img_contenttype) VALUES ( @img_name, @img_data,@img_contenttype )", connection );
MySqlParameter param0 = new MySqlParameter( "@img_name", MySqlDbType.VarChar,50 );
param0.Value = imgName;
command.Parameters.Add( param0 );
MySqlParameter param1 = new MySqlParameter( "@img_data", MySqlDbType.LongBlob );
param1.Value = imgbin;
command.Parameters.Add( param1 );
MySqlParameter param2 = new MySqlParameter( "@img_contenttype", MySqlDbType.VarChar,50 );
param2.Value = imgcontenttype;
command.Parameters.Add( param2 );
connection.Open();
int numRowsAffected = command.ExecuteNonQuery();
connection.Close();
return numRowsAffected;
}
I have no errors it tells me that the image is save but when i go to my database there is only new row with no data. Where i am wrong
P.S. I use MySql connector
-- modified at 13:09 Friday 17th March, 2006
|
|
|
|
|
i want to call a function dynamically which will differ according to my need. thing i need something like this:
<br />
private void FUNCTION_NAME(string ANY_STRING)<br />
{<br />
string ANOTHER_STRING="func"+ANY_STRING;<br />
ANOTHER_STRING.ANY_STRING();<br />
}<br />
i'll get ANY_STRING from some other source and that's the name which will refer the class name and part of function name too.
any help will be great
-- modified at 11:50 Friday 17th March, 2006
|
|
|
|
|
It's possible to do that using reflection, but I doubt that you really need that.
Why don't you explain what you are trying to accomplish, instead of asking how to do it the way that you think it's done?
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: It's possible to do that using reflection, but I doubt that you really need that.
Why don't you explain what you are trying to accomplish, instead of asking how to do it the way that you think it's done?
well.. i'm trying to do is, i have one xml file which maintains which modules user has choosen to use. then my app. will load those module detail in menu(this far i've completed). when user clicks one menu that particular module's entry function will be called. now menu click event passing me the 'SENDER', from which i can extract the menu name which i've to use as identifier(nothing else i've got better than this after having many suggestion from people). after clicking the menu i'll run the entry function of that particular module. the important thing is, one user may have choosen completely different modules than other.
|
|
|
|
|
Make a base class or an interface for the modules, so that you can call the method without caring which of the modules it is. To get the right module you can do a lookup-table, like putting references to the modules in a hash-table.
---
b { font-weight: normal; }
|
|
|
|
|
thanks for your reply i've fixed the problem with the help of reflection
|
|
|
|
|
Yes it is possible but i thing U need to create atleast atleast one Object for the class name that ur specifying in the string and u can use
Type t=typeof(ClassName)
t.InvokeMember("FunctionName", BindingFlags, null, obj, new FunctionArgsobj[]);
Hope it will help
Regards,
Thanks and Regards,
Srini
|
|
|
|
|
i did, and finally nothing happens, not even any exception.
|
|
|
|
|
Hello,
How can I wire the default clipboard events (Cut/Copy/Paste) to my menu items. The thing is, when you enter the edit mode for a treenode, and right click that node, the default context menu pops up, with the cut, copy, and paste events. However, I have same events in the main menu, so I want them to perform the same tasks on the treenode objects.
Thank you.
|
|
|
|
|
zaboboa wrote: How can I wire the default clipboard events (Cut/Copy/Paste) to my menu items.
You need to add code in your menu handler which uses the Clipboard object, e.g.
private void mnuEditCopy_Click(object sender, EventArgs e)
{
Clipboard.SetText(this.treeView.SelectedNode.Text);
}
What you get and put from the clipboard is up to you. What the right-click options are doing at the moment for the TreeView is cutting, copying and pasting the text for the TreeNode, not the actual TreeNode itself.
If you actually want to copy a TreeNode then you may be able to use the
Clipboard.SetDataObject
method (or something namely similarly to it).
Ed
|
|
|
|
|
Hi
I am struggling over getting the enum items name using reflection
say this the enum
/ Enum for Art Mode <br />
public enum tenumArtMode<br />
{<br />
artModeAuto=0,<br />
artModeManual,<br />
artModeInvalid<br />
} ;
Note:: this enum is in dll which is developed in VC++ .NET, I have added reference to access this enum in C#
I want to display this enum items using C#
I have tried the function Enum.GetName
tenumArtMode tenumMode;<br />
Type t=tenumMode.GetType();<br />
<br />
Enum.GetName(t.FieldType,t.GetValue(tenumMode));
But this throws me an ArgumentException
TIA
Srini
|
|
|
|
|
You can also simply do a ToString(). For example:
string s = tenumArtMode.arModeManual.ToString();
Would yield the string "artModeManual"
Good Luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
Thanks For your reply Mike,
No, This can't be applicable, b'cas i getting this enum at runtime so i would not know the enum item names.
Do understand my question. I want to iterate the enum using reflections
Regards,
Srini
|
|
|
|
|
You don't need reflection. The Enum class provides you with methods to get all information you nead about the enum.
Use the GetNames method to get an array of all the names. If you need their values, use the GetValues method to get an array with all the values.
---
b { font-weight: normal; }
|
|
|
|
|
If it is One Enum then your suggestions is OK. I can use Enum.GetNames(enum), But My situation is likes a structure which will contain lot of enums(say 100) as it member) so i can't write 100's lines of code to display every member
ie.
enum1<br />
{<br />
a=0,<br />
b,<br />
c<br />
}<br />
..<br />
enum100<br />
{<br />
x=0,<br />
y,<br />
z<br />
}<br />
<br />
Struct st<br />
{<br />
enum1 e1;<br />
enum2 e2;<br />
..<br />
enum100 e100;<br />
};<br />
<br />
Enum.GetNames(st.e1);<br />
..<br />
Enum.GetNames(st.e100);
Instead Puting like the above
I am thinking of reflection to reduce the line of code
Like this
Type ty = st.GetType();<br />
FieldInfo[] fin= ty.GetFields();<br />
foreach (FieldInfo fino in fin)<br />
{<br />
fino.GetValue(st).ToString();<br />
}
But This print the enum1..enum100 values like 0 0 0 0 ..
but I want to print the enum member names like a b c ...
Hope I Explained my question Clearyly
Regards,
Srini
|
|
|
|
|
I see. Try this, then:
Enum.GetName(fino.FieldType, fino.GetValue(st))
---
b { font-weight: normal; }
|
|
|
|
|
Exactly thats what i want, i have used the same code but it throws me me ArgumentException, i think since the enum is developed in VC++ .net fino.FieldType doesn't match with System.Enum Type in C#(since we are using Enum.GetName).. I think so.
Try it out and if anything works please share with me.
Regards,
Srini
|
|
|
|
|
Have you tried it out? It's not the same code as you showed in your first post.
---
b { font-weight: normal; }
|
|
|
|
|