|
Is the queue Transactional?
|
|
|
|
|
No,it isn't transactional!
|
|
|
|
|
well that's the only way that I can reproduce the problem. On a Non-Transactional Q your code works fine; with anything else I try to make it fail it throws an exception on queue.Send(...).
|
|
|
|
|
Hi,Jimmanuel!
Why didn't the message sent exist on the queue?
|
|
|
|
|
well, like I said, the only way that I could reproduce your problem was to make the Queue transactional in which case you need to supply some extra arguments to the Send method; example here[^]
other than that your code works on my system. If that's not the problem then I'm not sure what to suggest for you.
|
|
|
|
|
Hi,Jimmanuel!
Thank you very much!
I knew the reason why the message sent didn't exist on the queue.
The Message Queue is set to be transactional while my code is non-transactional.
But surprisingly,the code doesn't throw an exception!Why?
Thank you very much again!
|
|
|
|
|
I don't know why it doesn't throw an exception, but at least it's easy enough to check for in code. Glad you got it worked out!
Jim
|
|
|
|
|
Hi there I'm getting the following error when working with Crystal maby there is someone that can help???
Error 717 Error in file c:\report.rpt: Failed to load database information.
I'm working with an old foxpro database and I've checked the report path and all that is fine. It still doesn't work.
Thanks in advance
Stephen
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
i am developing c# desktop application. in that i want to connect to mysql database which is resides on another system.please give me an idea about this.
i have already replaced [
Data Source=MySQL Database;Server=localhost; user id=root;password=****;database=sample;pooling=true";] to
[Data Source=MySQL Database;Server=http://192.168.1.64; user id=root;password=gvsadmin;database=sample;pooling=true";]
is there any other way todo this?
this connection gives out the error Unable to connect to any of the specified MySQl host
thanks
|
|
|
|
|
You just asked this few posts down. You got a reply as well. Then why repost? Did you tried anything?
Try this website.[^]
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
You're an idiot.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
dilip514 wrote: [Data Source=MySQL Database;Server=http://192.168.1.64; user
192.168.1.64 IS A LOCAL IP, go to http://www.whatismyip.com and get your ip from there and use that, also, forward your ports properly.
|
|
|
|
|
Hi,
I have many checkboxes inside a TableLayoutPanel() control.
I have added a another checkbox named SelectAll outside the table..
I used the following code for the SelectAll option, but it does not work...Please help me with this
private void SelectAll_Click(object sender, EventArgs e)
{
if (SelectAll.Checked)
{
cb.Select();
cb1.Select();
}
}
|
|
|
|
|
AFAIK there is no Select method in CheckBox class. Checked is the property you should use.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
if (SelectAll.Checked)
foreach (var checkBox in this.tableLayoutPanel1.Controls.OfType<checkbox>())
checkBox.Checked = true;
Eslam Afifi
|
|
|
|
|
The checkboxes are not on the form but on the panel.
this. is assumed if not specified so your code reads:
this.cb.Select();
If you try:
for (i = 0;i < many; i++)
{
string checkname = "cb" + i.ToString().Trim();
checkbox checkitout = (checkbox) this.NameOfPanel.Controls[checkname];
checkitout.Select() = true;
}
This is aircode, so please mind the caps. I also don't know what the Select() property is, but I'll assume you've defined your own checkboxes.
you also see that it is advisable to rename the first checkbox from cb to cb0.
succes !
|
|
|
|
|
Hi
i have a dagaridview view bind to an empty dataTable, user can insert values directly into datagridview and then click Save. when user clicked Save button, i write this code to iterate through dataTable records and insert to my database in transaction mode :
using (SqlConnection con = new SqlConnection("data source=.;initial catalog=test;Trusted_Connection=Yes"))
{
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "insert Person(titleId,fname,lname) values(@titleId,@fname,@lname)";
con.Open();
System.Transactions.TransactionOptions trOptions = new System.Transactions.TransactionOptions();
trOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
trOptions.Timeout = new TimeSpan(0, 0, 15);
using (System.Transactions.TransactionScope ts = new System.Transactions.TransactionScope(System.Transactions.TransactionScopeOption.Required, trOptions))
{
try
{
foreach (DataRow row in this.dt1.Rows)
{
int titleId = int.Parse(row["titleId"].ToString());
string fname = row["fname"].ToString();
string lname = row["lname"].ToString();
if (cmd.Parameters.Count > 0)
cmd.Parameters.Clear();
cmd.Parameters.AddWithValue("@titleId", titleId);
cmd.Parameters.AddWithValue("@fname", fname);
cmd.Parameters.AddWithValue("@lname", lname);
cmd.ExecuteNonQuery();
}
con.Close();
ts.Complete();
}
catch (Exception ex)
{
}
}
}
I want, all of insertion execute in transation, for test, at runTime i was entered correct row in first datagridview row and then entered incorrect row in second with cause exception, but at runTime the first records has been inserted wheras i want when error has occured, all inserted records rollback.
Can anybody help me ?
Thanks
|
|
|
|
|
Use BeginTransaction, Commit and Rollback methods in SQLTransactionClass.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Hi d@nish
Yes i know this, but i want to do this by TransactionScope calss and i want to know where does my mistake and how to solve it ?
thanks
|
|
|
|
|
Hi,
Is there any way to avoid restricted method while iterating the method using GetMethods() and properties using GetProperties().
GetMethods() - Using Binding Flags we can filter public ,static,Instance methods.How tofilter out restricted methods.
Generealy Restricted methods are not available for macro progarmming language like VB.
Pls help me ...
By
Rajanbabu
Rajanbabu
|
|
|
|
|
rajanbabu_033 wrote: restricted method
?? You mean Private ?
Read this post Obfuscation[^]
|
|
|
|
|
Hi,
Please help me for the following issues.
In CSharp GetMethods() is returning all the methods and properties of particular Type instead method alone.
How to get the all the methods of particular Type?It should not contain any get,put properties.
I have a sample CSharp program here....
namespace ReflectionDemo
{
class MyClass
{
public void display()
{}
public int RegisterNumber
{
get
{
return 0;
}
set
{
}
}
class ReflectionDemoClass
{
static void Main(string[] args)
{
MyClass mc = new MyClass();
Type tt = mc.GetType();
MethodInfo[] methInfo1 = tt.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);
foreach (MethodInfo mI1 in methInfo1)
{
string methodName = mI1.Name;
System.Console.WriteLine(mI1.Name);
}
}
}
output for this program is :
display
get_RegisterNumber
set_RegisterNumber
Above output have both methods and Properties
but i want to get output : display
Could anyone help me to get this answer(I mean only methods of MyClas not the properties)?
By
Rajanbabu
Rajanbabu
|
|
|
|
|
Hi,
You could use MethodInfo.IsSpecialName , so you'll get the methods only by checking (mI1.IsSpecialName == false )
Calin
|
|
|
|
|
Thanks a lot Calin.It's working fine.This solution is very much helpful for my project.
I have one more clarification also please help me if possible,
Issue :
I hope you are aware that restricted methods are not available for Visual basic users.
E.g.,
interface IFunctionParameterDemo : IDispatch
{
[id(1),restricted,helpstring("method Display")] HRESULT Display();
[id(2),helpstring("method Calculate")] HRESULT Calculate();
};
coclass FunctionParameterDemo
{
[default] interface IFunctionParameterDemo;
};
Here method Display() is marked as restricted by the attribute restricted.So we can't use this method from Visual basic(If we call this method from VB,during compile time it will show error as "Method or Interface marked as restricted")
In reflection is there any way to filter out these restricted methods?
Type t = GetType(FunctionParameterDemo);
MethodInfo[] mInfo = t.GetMethods();
foreach (MethodInfo m in mInfo)
{
System.Console.WriteLine(m.Name);
}
output:
Display()
Calculate()
But I want the output : Calculate()
using GetMethods() i want to get the result of Calculate()alone.It should filter out restricted method Display().
Regards,
M.Rajanbabu.
|
|
|
|
|
Can somebody tell me why this code is not working. It keeps saying
"A datasource instance has not has not been supplied for the data source.
Also I have scoured the web for some good documentation on how to set these up on the fly but I have not found any great info. Can somebody point me in the right direction?
private void toolStripButton1_Click_1(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
try
{
// Set Processing Mode
reportViewer1.ProcessingMode = ProcessingMode.Local;
// Set RDL file
reportViewer1.LocalReport.ReportPath = (Application.StartupPath + "\\reports\\trdReport.rdlc");
// Supply a DataTable corresponding to each report data source
reportViewer1.LocalReport.DataSources.Add(
new ReportDataSource("getTrends", LoadData()));
// Add the reportviewer to the form
reportViewer1.Dock = DockStyle.Fill;
// Process and render the report
reportViewer1.RefreshReport();
}
catch (Exception ex)
{
StreamWriter writer = new StreamWriter(logFile, true, System.Text.Encoding.ASCII);
writer.WriteLine(System.DateTime.Now);
writer.WriteLine("[generate report]");
writer.WriteLine("[generate report]");
writer.WriteLine(ex);
writer.WriteLine("\r");
writer.Close();
MessageBox.Show(ex.ToString());
//this.Close();
//System.Environment.Exit(0);
}
this.Cursor = Cursors.Default;
}
private DataTable LoadData()
{
// Load data from XML file
DataSet ds = new DataSet();
string myFilePath = (Application.StartupPath + "\\bin\\" + "trd.xml");
ds.ReadXml(myFilePath);
return ds.Tables[0];
}
tia
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|