|
+ @Mark
Fixed!
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Hei,
Is there any way by which we can design culture dependent Crystal Reports. e.g. For German language all the captions inside the crystal report converted in to german language and so as french.
Thanks
Syed Shahid Hussain
|
|
|
|
|
Hi All,
I need to retrieve date in a SQL Server 2005 Database and Generate Insert and Update SQL scripts for the data in the Database so I can run the SQL scripts in another database.
To do that is there a way to get the data about the tables like the table name, column names, data types, etc. So I can write a common Insert and Update Statements, which can be used for all the tables.
Thanks in advance.
|
|
|
|
|
In SSMS look into the system views, they are designed to service this requirement. You can also investigate the sysobjects table if the views do not meet you needs.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
SMO makes this relatively painless. This[^] link should help you get started.
/ravi
|
|
|
|
|
Hei,
For multilingual application we have to use a new separate resource file for each form. So in this way we cannot reuse our translation that we have done in any other form.
My question:
Is there any way by with we can use a single global language resource file at all forms? In this way we may be able to resue our translations.
Thanks
Syed Shahid Hussain
|
|
|
|
|
Why not bind to the default resource file instead and then localize that?
|
|
|
|
|
because it repeats the translation...
Syed Shahid Hussain
|
|
|
|
|
I don't understand exactly what you mean. Is it that you want to have one single big resource file for all your forms instead of one file per form, so that you can re-use e.g. the translation of the OK and Cancel buttons in many places?
Well, it is possible. But then you must do a lot of the assignment of the localized text manually, something like
label1.Text = ResourceManager.GetString("Form1_label1_Text");
That can be automated, with automatically generated resource names. But if it is the translation which you want to re-use, that automatization won't help.
You could extend all text containing elements with an extra property holding the resource name (thus allowing you to re-use the resource), but that will also take a lot of manual work before. Then you could get to some
label1.Text = ResourceManager.GetString(label1.ResourceName);
which can be easily made more generic, with enumerating all components on a form etc.
|
|
|
|
|
Thanks
but i think in this way i'll wast much time. So the auto process thaat is waht i'm doing is fine i think....!!!
Thanks after all...
Syed Shahid Hussain
|
|
|
|
|
I have a list which is derived from CollectionBase, and it contains a list
of User objects, which I want to Serialize.
Is there anywhere where I can find how to decode it so that it recognizes
what objects are held in my list? or an example in C# prefereably?
Thanks In Advance
|
|
|
|
|
|
Sorry for my bad english, I am trying to do some thig like below
Class A : Base
{
\\do somethig
}
Class B : Base
{
\\do somethig
}
Class Base
{
\\do something
}
Class Test<object> : CustomCollection
{
\\do methods like Add,Remove.....
}
Class Main
{
Test<object> Obj = new Test<object>
Obj.Add(A);
Obj.Add(B);
}
Now I want to pass the Obj object from Main call to a webservice How
can I achieve this?
Thanks In Advance
|
|
|
|
|
Services and object orientation do not play well together.
I don't think it is desirable (I'm not sure it is even possible) to pass up a Test<object> .
The list / array needs to be of a known type, passing up a Test<Base> is certainly an option in WCF, but you need to register A and B as KnownTypes. What you have done gives off a "bad code smell", the class structure is perfectly fine from an OO point of view (I'm not sure of the purpose of Test<Object> or CustomCollection however), but when calling services it is much better to use well defined types for making calls, and the onus is on the server to provide these types. Addtionally [if memory serves] custom collections / Lists are frowned upon in asmx services as they won't interop well with Java etc.
The normal pattern with services is:
1. Define types that can be passed up and down the wire in web service calls.
2. Make method calls that use the defined types in step 1.
3. Use Wsdl.exe to generate a proxy class to communicate with the web (asmx) service
You then will probably need to convert the types passed up and down the wire into your proper object model.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Hi,
I've written a number of Crystal reports, and I would like to get my report viewer to bind the report on change of dropdown. This does work, however for each one change it asks for the parameter information again. Below is my source - the parameters are the same across all reports and are held in session:
protected void Page_Load(object sender, EventArgs e)
{
if ((ViewState["ParametersShown"] != null) &&
(ViewState["ParametersShown"].ToString() == "True"))
{
ReportListing myListing = new ReportListing();
BindReport("MYPATH" + myListing.GetReportFileName(Session["Report"].ToString()));
}
}
protected void btnBuild_Click(object sender, EventArgs e)
{
DateTime startDate = DateTime.Parse(Session["FromDate"].ToString());
DateTime endDate = DateTime.Parse(Session["ToDate"].ToString());
ParameterFields paramFields = new ParameterFields();
ParameterField crStartDate = new ParameterField();
ParameterField crEndDate = new ParameterField();
crStartDate.Name = "@StartDate";
crEndDate.Name = "@EndDate";
ParameterDiscreteValue dcrStartDate = new ParameterDiscreteValue();
ParameterDiscreteValue dcrEndDate = new ParameterDiscreteValue();
dcrStartDate.Value = startDate;
dcrEndDate.Value = endDate;
crStartDate.CurrentValues.Add(dcrStartDate);
crEndDate.CurrentValues.Add(dcrEndDate);
paramFields.Add(crStartDate);
paramFields.Add(crEndDate);
CrystalReportViewer1.ParameterFieldInfo = paramFields;
ReportListing myListing = new ReportListing();
BindReport("MYPATH" + myListing.GetReportFileName(Session["Report"].ToString()));
ViewState["ParametersShown"] = "True";
}
private void BindReport(string FilePath)
{
ReportDocument Report = new ReportDocument();
Report.Load(FilePath);
SetTableLocation(Report.Database.Tables);
CrystalReportViewer1.ReportSource = Report;
}
private void SetTableLocation(Tables tables)
{
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = ConfigurationManager.AppSettings["ReportDBServerName"].ToString();
connectionInfo.DatabaseName = ConfigurationManager.AppSettings["ReportDBDBName"].ToString();
connectionInfo.UserID = ConfigurationManager.AppSettings["ReportDBUserID"].ToString();
connectionInfo.Password = ConfigurationManager.AppSettings["ReportDBPassword"].ToString();
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogOnInfo = table.LogOnInfo;
tableLogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);
}
}
|
|
|
|
|
Hi James if want to pass same vaules to multiple times just save that values in cache and pass them when it required
|
|
|
|
|
Hi,
I have a 'C' API with signature as :
int Init(myStruct* struct, void** pHandle);
This pHandle is to be given as input in subsequent APIs.
My problem is that I have to access this in C#.
Any ideas how to do this ?
|
|
|
|
|
This can be done with p/Invoke. You'll find a lot of examples on this if you google.
Good luck!
|
|
|
|
|
See here[^] on MSDN, which explains the mechanisms and the things to be aware of when communicating between managed and unmanaged code.
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hey Richard,
thanks for the reply. I have added some more explanation in my query. Can you have a look & let me know if it is OK or not ?
Thanks
|
|
|
|
|
Some more details :
'C' code :
-----------
int Init(myStruct* struct1, void** pHandle)
{
<...some code...>
*pHandle = sess_open(struct1, &session);
<...some code...>
}
'C#' code :
-------------
Declaration:
--------------
[DllImport("My_C_Library.dll")]
public static extern int MY_CSHARP_INIT(myStruct* struct1, ref System.IntPtr[] Session_pp);
Implementation:
----------------
public int MY_CSHARP_INIT(myStruct* struct1, ref System.IntPtr[] Session_pp)
{
int ret_val = Init(struct1, ref Session_pp);
}
-------------------------------------------------------------------------
This gives a Exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
-------------------------------------------------------------------------
Any help appreciated.
|
|
|
|
|
You are trying to pass a pointer to a C# (i.e. managed) struct as an unmanaged reference, which will not work. You need to look at the marshalling options to see how the C code can access your C# objects. I have a suspicion that you cannot do it this way, but would need to convert your struct to some sort of basic array for the unmanaged (i.e. C) code to be able to access it.
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi,
two parameters using pointers, that is two potential problems. Try to split the job in halves, if you own the native code, experiment with a single parameter first.
For the struct pointer, I would opt for ref myStruct .
For the array of pointers, if the managed side does not NEED to know it is an array, just make it an IntPtr ; if it must operate on array elements, the only easy way I know of is by:
- somehow knowing the element count (if need be, add another method to obtain it from the native world);
- then allocate the array on the managed side;
- then pass its pointer to the native world, which I prefer to handle with a GCHandle, GCHandleType.Pinned, AddrOfPinnedObject.
Conclusion: you may not even need unsafe code.
|
|
|
|
|
hi i hava a groubox contain 5 textbox control and i want to empty the all textbox i'm having hard time to solve pls any idea..
|
|
|
|
|
And what have you tried? It's not that difficult.
I know the language. I've read a book. - _Madmatt
|
|
|
|