|
Hi,
I try to use SMO for backup from my network server. But it's giving error like "Backup Failed for server "1.1.1.10"...
Anybody can point me that where I have a mistake...from the below code...?
Thanks
<pre>ServerConnection Conn1 = new ServerConnection("1.1.1.10", "admin", "xxxxxxxxxx");
Backup Mybackup = new Backup();
Server srv = new Server(Conn1);
srv.ConnectionContext.LoginSecure = false;
srv.ConnectionContext.Login = "admin";
srv.ConnectionContext.Password = "xxxxxxxxxx";
srv.ConnectionContext.Connect();
Mybackup.Action = BackupActionType.Database;
Mybackup.Database = "Invoice_Master";
Mybackup.Devices.Add(new BackupDeviceItem("C:\\Temp\\CHECK\\MyInvoices.bak", DeviceType.File));
Mybackup.BackupSetName = "For_Bills";
Mybackup.SqlBackup(srv);
|
|
|
|
|
Does Sql Server have write-rights on that specific path? In other words, can you backup to there using the Management Studio?
Bastard Programmer from Hell
|
|
|
|
|
Thanks Eddy...
Yes...Its a mapped drive path...
Also I manually use to take the backup daily by the following manner.
backup database Invoice_Master to disk="C:\MyPath\BackupName.bak"
|
|
|
|
|
Thanks Eddy...!
I got it, Thanks again!
|
|
|
|
|
Hi, I am new to InfoPath, and I am having an issue with a web-based form. I have a Rich Text Box that is in a repeating section that is
bound to an XHTML field. This is not in the main/default view, and the user can submit the form from the main/default view and from the
sub-view with this control in it. When the user adds more than one of these Rich Text Boxes to the form, the data that has been entered into
the field isn't always saved. I have, however, never seen the first time not be saved.
Scenario 1:
user enters text into the Rich Text Box. Then clicks the submit button. The text in the first Rich Text Box keeps the user entered text as
expected. The user then adds another field, enters text, and clicks submit. The form then saves, however, the newly entered text in the
Rich Text Box sometimes changes to "", and sometimes the text in the Rich Text Box stays as the newly entered text as expected
Scenario 2:
After clicking submit and the data stays as expected, the user then wants to change the value that is in the Rich Text Box. The user enters
new data in the Rich Text Box and presses submit. The form then saves, however, sometimes the text in the Rich Text Box changes back to
the data that was there previous to the user's changes, and sometimes the text stays as the newly entered text as expected.
This seems to be a random error. It sometimes happens on the second entered Rich Text Box and sometimes doesn't happen until the
4th or 5th. This error doesn't happen when debugging the form in infopath. The C# code I am using to debug this issue is on the submit
button clicked event.
XPathNavigator domNav = MainDataSource.CreateNavigator();
XPathNodeIterator rows = domNav.Select
("/my:myTipLead/fxintakerequest:IntakeRequest/fusionx:AnalystNotes/fusionx:AnalystNote/fusionx:NoteText"
, NamespaceManager);
while (rows.MoveNext())
{
EventLog.WriteEntry(ERROR_SOURCE, "node value = " + rows.Current.Value);
}
The event log show all of the times it acted as expected. When it fails to save the text entered, the event log has all of the previously entered Rich Text Box data and the newly entered Rich Text Box entry says "not value = ". I'm assuming that the text is never getting into the field. Any help would be much appreciated. Thank you!!
P.S. I know this isn't exactly a C# issue. I posted it in the SharePoint forums becuase we are using SharePoint to host our forms, and I was told that this was not a SharePoint issue. I'm not exactly sure where to post this question
|
|
|
|
|
Hello all,
how can i create textBox in C# with email autocomplate exactly like "outlook To field" ??
|
|
|
|
|
Subscribe to the text changed event of the text box. Filter your list of potential suggestions using the current Text property. Display a listbox filled with the suggestions below the text box. In the double click event of the list box, get the currently selected item, transfer that to the text box, and close (hide) the list box.
|
|
|
|
|
don't forget to temporarily prevent the text changed event firing when you set textbox to the selected value (by either -= the event handler and then += it back, or by using a bool flag). If you don't you'll get an infinite loop
Pedis ex oris
Quidquid latine dictum sit, altum sonatur
|
|
|
|
|
What technology are you targetting? Win Forms, WPF, Silverlight, ASP.NET?
The common thing for you to look at though, is that the text changes on every keypress (or on a paste operation), and this gives you something to filter your larger list on - and the results are displayed in some form of panel beneath the textbox.
|
|
|
|
|
|
If you're using WinForms, set AutoCompleteMode = Suggest , AutoCompleteSource = CustomSource and AutoCompleteCustomSource = (your list).
|
|
|
|
|
Hi I have created the usercontrol which is having autocomplete feature. It contains the controls combobox and listbox in the user control. I can't use the default autocompelete feature of the combobox or textbox due to some client's issue.
The user control is then implemented in the form which is having tablelayoutpanel control. But the issue is that the listbox is hiding in the tablelayoutpanel control.
I tried to set "Bring to front" of listbox/usercontrol. But could not solve the issue. Even I used setchildIndex but not useful.
Is there anything I can do to solve the issue?
|
|
|
|
|
have you tried setting the minimum size so that the control can't 'shrink' down so far as to hide its component controls?
Pedis ex oris
Quidquid latine dictum sit, altum sonatur
|
|
|
|
|
I did not find any property to set the minimum height of the control. Can you please explain how can we do that?
modified 15-Feb-12 3:13am.
|
|
|
|
|
I am assuming you are working in winforms
The UserControl class (from which I assume you are inheriting) exposes a MinimumSize property of type Size which, in turn, exposes height and width int properties
Pedis ex oris
Quidquid latine dictum sit, altum sonatur
|
|
|
|
|
I tried with minimum height. Its not solving my issue.
|
|
|
|
|
Hi all,
I am in the process of coding a generic wrapper class that adds some metadata and functionality to a generic value (unconstrained). I would prefer the equality of this wrapper to simply pass through to the underlying value.
As a result the equals and getHashCode overrides are as follows
public override bool Equals(object obj)
{
return _value.Equals(obj);
}
public override int GetHshCode()
{
return _value.GetHashCode();
}
My concern here is that, as _value is not read-only, we now have a hash code that could potentially change.
Am i right to be concerned about this with regard to housing the class within collections or using it within LINQ statements? (IIRC they make use of hashtables behind the scenes)
Is there a better/safer approach?
Thanks in advance
Pedis ex oris
Quidquid latine dictum sit, altum sonatur
|
|
|
|
|
This could, I think, potentially cause problems if you're using instances of this class in the key of dictionaries. But no more so than if you put _value in there instead, and there's not really a way to avoid it with mutable types.
I think that you are only going to be sacrificing a bit of performance, not creating subtle bugs, because the .Net hashtable will look through all the items if it doesn't get a hash hit. Generally, you wouldn't put mutable things into collections as a key anyway.
There are only two 'golden rules' of GetHashCode, to quote the documentation[^]:
If two objects compare as equal, the GetHashCode method for each object must return the same value. However, if two objects do not compare as equal, the GetHashCode methods for the two object do not have to return different values.
The GetHashCode method for an object must consistently return the same hash code as long as there is no modification to the object state that determines the return value of the object's Equals method. Note that this is true only for the current execution of an application, and that a different hash code can be returned if the application is run again.
You generally want to use as much of the state (which you compare within an Equals override) as possible to make the hash code uniqueness work well, and that means that if you mutate the object you change its hash code, which could cause a minor slowdown next time you look 'it' (i.e. something that matches it by Equals) up.
So in conclusion, you're okay, but good question, and it's good practice not to mutate things (at least, not to mutate the parts of them which are part of their equality semantics) if they're being used as dictionary keys.
|
|
|
|
|
Excellent explanation.
Thanks for putting my mind at ease
Pedis ex oris
Quidquid latine dictum sit, altum sonatur
|
|
|
|
|
BobJanova wrote: I think that you are only going to be sacrificing a bit of performance, not creating subtle bugs, because the .Net hashtable will look through all the items if it doesn't get a hash hit.
No, it won't. Mutating an object that is used as a dictionary key will cause bugs.
The correct solution is to remove the object from the dictionary, then mutate the key, then re-add it. Or better, just make the key immutable, remove the object from the dictionary, and re-add it using another key.
|
|
|
|
|
Then make it immutable / readonly; it probably should be anyway.
|
|
|
|
|
can't make it readonly im afraid.
The class is providing a solution to firing off propertyChanged notifications without having to rely on hardcoded property name strings (it provides a 'single run per property' means by which property names are programatically derived)
As a result the wrapper class is being used in place of a basic property backing field and therefore must be able to have its value changed as and when required.
hope that makes sense
Pedis ex oris
Quidquid latine dictum sit, altum sonatur
|
|
|
|
|
Hi All,
I would like to develop a windows desktop application in C# which would display the video from a Raysharp DVR sitting in my network. I would like to know if there is any SDK available (compatible with raysharp dvr) which can be useful. Raysharp is using H264 encoding to stream the video.
If anyone can direct me to any site or could help with some idea, will be very much helpful.
Thanks in Advance
Jayesh
|
|
|
|
|
Ask these guys[^] for an SDK.
I would suspect that you cannot play the video because, at least on the security system I worked with, the video stream was encrypted. This would be for legal reasons as surveilence video is admissable as evidence. Any files saved from the system would need to be played in the player supplied by the vendor because of the encryption.
|
|
|
|
|
Hi,
But i can see the video in my iPhone using a couple of third party applications. This will raise two options, either the suppliers have access to the encryption (which seems to be very less) or there is no encryption at all..
please let me know your thoughts on the same.
Thanks
jayesh
|
|
|
|