|
Thanks Eduard for your reply.....
could you please elaborate or send me a link for xPath and the other solution described by you.
Also, how i will be reading the find from end....
Praveen Raghuvanshi
Software Engineer
|
|
|
|
|
xPath is supported by the .NET framework in the namespace System.XML.XPath. You can find loads of manuals, how-to's and articles around the web.
I love it when a plan comes together
|
|
|
|
|
Hi guys,
Please help!!! this issue is driving me crazy. I have a crystal report which during creation I used an Oledb connection with SQL server 2000 to fetch the tables. In my C# code I am passing dbname, server, id and pwd to another server and I am getting a problem because I believe the report is trying to look for the OLEDB settings that I had used during the report creation.... I don't know if I am making any sense, here is my code.
try
{
bool rt=true;
string sErrMessage=string.Empty;
DBUtilObj obj = null;
obj=new DBUtilObj();
rt=obj.g_sGetConnectString(out m_sCnn, out m_sServer, out m_sDBName, out m_sUserId, out m_sPassword,out sErrMessage);
cryShared.TableLogOnInfo tbLogInfo=null;
Pinn rpt = new Pinn();
foreach ( cryEngine.Table tb in rpt.Database.Tables)
{
tbLogInfo=tb.LogOnInfo;
tbLogInfo.ConnectionInfo.ServerName=m_sServer;
tbLogInfo.ConnectionInfo.DatabaseName=m_sDBName;
tbLogInfo.ConnectionInfo.UserID=m_sUserId;
tbLogInfo.ConnectionInfo.Password=m_sPassword;
tb.ApplyLogOnInfo(tbLogInfo);
tb.Location="\"" + m_sDBName+".dbo.\"" +
tb.Location.Substring(tb.Location.LastIndexOf(".")+1);
}
crystalReportViewer1.ReportSource=rpt;
}
catch(Exception ex)
{
MessageBox.Show(this, ex.Message,"SelecSoftware Pinnacle+™",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
finally
{
}
Please help!!!!!!!!!!
sasa
|
|
|
|
|
Hello,
I would like to make a call to a web service at regular intervals and I'm interested in opinions on how best to do it.
My web service will need to read in some data from a database and move it to another application. This needs to happen for one case every 10 minutes, another case every hour and another case every 24 hours.
The easiest method I think is to use the built-in Windows Task Scheduler service as I've read somewhere that a Windows service would probably be overkill for what I want to do - the web service can report success if it is called so there's no need to audit the Windows Task Scheduler (I understand that there are potential problems with relying on the WTS to report errors).
The WTS seems a bit of a poor cousin of UNIX/Linux's cron. I wonder why MS has never bothered turning it into something actually useful?
So, can anyone tell me how to:
1. Add a job to the WTS which will call a web service (how do I call a web service on the command line)?
2. Implement something better - can I implement something in the web service itself or should I just write a separate service for each process that needs to call my service.
Thanks
|
|
|
|
|
Erhm, there are several issues you're talking about. For example, you say the webservice can report whether your process was succesfull. In fact, the webservice can only report that the webservice process went succesfull. It did send the data to your app. The webservice cannot report whether the parsing of that data on your 'local' machine was succesfull.
Second, you cannot start a webservice from the commandline. You need to develop an app. which has a reference to the webservice and invoke a method within the webservice. You should schedule your app calling, and make you app report if something went wrong (and what) or (which is what we aim for) everything went fine.
I think you can schedule you app. using WTS don't think you'll run into problems there.
|
|
|
|
|
thx for the reply.
The web service will exist on the same machine as the database and the application so no problem there
I don't want to start the web service from the command line, I just want to call a method on the web service. I did find this though which seems to work well:
Save the following as MSFT.vbs:
set SOAPClient = createobject("MSSOAP.SOAPClient")
SOAPClient.mssoapinit "http://www.webservicex.net/stockquote.asmx?WSDL"
WScript.Echo "MSFT = " & SOAPClient.GetQuote("MSFT")
Then from a command prompt, run:
C:\>MSFT.vbs
I just have to verify it working under WTS now
|
|
|
|
|
If you are using SQL Server, you should consider using DTS/SSIS instead. These have been designed to do exactly what you have stated. A web-service gives you no benefit, and requires a lot of extra work that is taken care of by SQL Server.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thx, my fault for not being clearer - when I say reading data from a database I'm actually calling another web service (from my web service) which provides the data from a crm system. Totally agree about DTS if it were just a SQL server of course
|
|
|
|
|
If you've got SQL Server 2005, then you could still do this. Bear in mind that you can host CLR applications inside SQL Server, so you would still be able to leverage this.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My apologies to Mexicans by the way for the screen name - it's a temporary one I got from bugmenot.com and I didn't realise it could be construed as being offensive. I'm on site at the moment and haven't got my proper details
|
|
|
|
|
This is how a checkedlistcontrol is populated:
chklstUserRoles.DataSource = dsUsersAndRoles.Tables["Roles"].DefaultView;
chklstUserRoles.DisplayMember = "Name";
chklstUserRoles.ValueMember = "RoleID";
I would like to loop through a checkedlistBox control and collect the IDs that is allocated to each checked item in the control.
This does not quite work:
for (int i = 0; i <= chklstUserRoles.CheckedItems.Count - 1; i++)
{
strRoleIds += chklstUserRoles.SelectedValue.ToString() + ",";
//strRoleIds += chklstUserRoles.CheckedItems[i].ToString() + ",";
}
Thanks
|
|
|
|
|
How to check if network share requires authentication from me using WMI or any other way ?
Thanks.
|
|
|
|
|
The only way to tell is to try and access it. If it fails, then you need to authenticate to the target server.
WMI won't help you in this case.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm trying to find out how to bind an Itemtemplate which is dropdown ascx control to another data bound column in a webgrid.
I have this:
************************************************************
Diary di = Diary.GetDiaryItem(d);
grdDiary.DataSource =di.DiaryHistory;
C1.Web.C1WebGrid.C1BoundColumn col1 = new C1.Web.C1WebGrid.C1BoundColumn();
col1.DataField="DiaryEvent";
grdDiary.Columns.Add(col1);
C1.Web.C1WebGrid.C1TemplateColumn col2 = new C1.Web.C1WebGrid.C1TemplateColumn();
col2.ItemTemplate = LoadTemplate(@"Modules\EventCtl.ascx");
grdDiary.Columns.Add(col2);
grdDiary.DataBind();
**************************************************************
col2(dropdown) needs to reflect col1
Any help would be gratefully received!!
|
|
|
|
|
Hi all! Please clarify my one doubt regarding new operator. When it is needed to use new while creating an object.
Don't Quit
|
|
|
|
|
Nitin1981 wrote: When it is needed to use new while creating an object.
always.
|
|
|
|
|
Hi J4amie C! Thanks for reply. Please clarify few doubts.
1. Is it necessary to be used with reference types only?
If so why DataReader can be used without new.
2. If value types dont reuire a new then
Why in windows forms it is used like this?. where point(it is a structure) is a value type.
Form1.location = new System.Drawing.Point(x,y);
Regards
Don't Quit
|
|
|
|
|
Nitin1981 wrote: If so why DataReader can be used without new
It can't. It is just the new data reader is instantiated inside the ExecuteDataReader method rather than in YOUR code.
Nitin1981 wrote: If value types dont reuire a new then
Value types require a new. You might be getting confused with primative types (e.g. 1, true, 3.1415, "some string") which also happen to be mostly value types (strings are reference types)
|
|
|
|
|
Nitin1981 wrote: 1. Is it necessary to be used with reference types only?
Yes. If it's not a reference type, then it doesn't handle an object.
Nitin1981 wrote: If so why DataReader can be used without new.
It can't. But it's not you who create the DataReader, so it's not needed in your code.
Nitin1981 wrote: Why in windows forms it is used like this?. where point(it is a structure) is a value type.
Form1.location = new System.Drawing.Point(x,y);
A value type may have a constructor, but it will not create an object, it will just return a new value. A value type also always has a parameterless constructor, that returns a value where all members are zero.
A value type declared as a member of a class will be initialized to zero when an object of the class is created. A value type declared as a local variable in a method will be undefined, and the compiler won't let you use it before you have assigned a value to it.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Nitin1981 wrote: If so why DataReader can be used without new.
It is common practice to provide a method that instantiates an object and returns it to you without requiring you to do anything to create it. ExecuteDataReader internally creates a DataReader and returns an instantiated version to you.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
you either need to call new to create a new object or make a call that calls new on an object.
Think of the Color object
Color myColor = Color.Red;
Or the dataReader
DataReader myDataReader = myCommand.ExecuteReader();
The DataReader is easier to explain
There is a method on the command object that looks something like:
public DataReader ExecuteReader()
{
Some code.....
DataReader returnReader = new DataReader();
Some more code....
return returnReader;
}
I assume that the DataReader() constructor is private or internal so can't be called by me but the DataReader can use it fine.
For the Color example:
There will be a property like:
public static Color Red
{
get
{
return new Color(255,0,0);
}
}
You don't write new in either case but new has been called somewhere on your behalf.
HTH
Russ
|
|
|
|
|
Hello,
new is a keyword used to create objects in the memory. Yes, it is only used for declaring reference types.
new allocates memory in the heap for the object and after allocation returns its reference ( memory address ) back to the stack. you can then store that refernce in your object reference.
About DataReader, yes it is correct. new is called inside ExecuteDataReader, so you can not see it.
I hope it helps you.
Kindest Regards,
|
|
|
|
|
interface Mirror wrote: Yes, it is only used for declaring reference types.
No, Value types and reference types.
|
|
|
|
|
J4amieC wrote: interface Mirror wrote:
Yes, it is only used for declaring reference types.
No, Value types and reference types.
You can declare without new .
And everything in .net is an object, so int x = new int() ; is valid, but unnecessary.
Essentially, new calls the constructor of a class (or struct) to create a new instance of that class (or struct). In the case of Command.ExecuteReader() that call is made inside ExecuteReader to save you from the details.
You may also be used to creating the Command object with new , but you don't have to, the Connection has a CreateCommand method that will do that for you. I wish the Command object had a method to create a DataAdapter too
|
|
|
|
|
interface Mirror wrote: new is a keyword used to create objects in the memory. Yes, it is only used for declaring reference types.
new allocates memory in the heap for the object and after allocation returns its reference ( memory address ) back to the stack. you can then store that refernce in your object reference.
The new keyword can also be used to create values of a value type. In that case it won't create an object on the heap, it will just return the value.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|