|
Just start with the basics. Here[^] is a good article on Word Automation to start you off.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I am doing an assignment on Backup + Restore database with Stored Procedures.
Backup is ok, but Restore the error: "RESTORE cannot process database 'db_test' because it is in use by this session. It is recommended that the master database be used when performing this operation.".
I tried to fix but the document has not been, hope admin help with this problem. Thanks!
Link source: http://www.mediafire.com/?c1uldq2t7eczw3b
I use C # VS2010 + sql server 2005.
|
|
|
|
|
You are restoring a database that you are also probably using at the same time.
Try making sure you run a restore in the master database.
|
|
|
|
|
I used sql queries Restore is done, but 'Stored Procedures' are not. So I asked to use the 'Stored Procedures' can not do this. And if so please help me modifying my demo about Restore using 'Stored Procedures'
. Thank you very much.
Link: http://www.mediafire.com/?c1uldq2t7eczw3b
|
|
|
|
|
Hi Guys ,
Stuck up in small issue can u any one please help me out of this.
I have exported a excel report as below. But last statement is not executing. After downloading it i want to navigate to other page, But it is throwing exception. I understood that i am clearing the HTTP Response. But can i cal one more HTTP?? or how can i navigate to other page.. Please help on this
string attachment = "attachment; filename=Export.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End()
Response.Redirect("Downloaded.aspx",false); [Problem][Exception]
|
|
|
|
|
Think about it. When you execute Response.End, that's it. There's nothing else being sent to the client. You cannot redirect a client after you call Response.End.
|
|
|
|
|
Always wrap your code in "pre" tag.
|
|
|
|
|
Hi,
I just need your advise please.. where is the best place to save my error.log? is it in the application folder? or some other common folder?
Thanks,
Jassim
|
|
|
|
|
|
Bert Mitton wrote:
I'll usually save it in the application folder.
It's easier to find, and it can't get confused with the error log from another
program.
and is usually read-only to users running the app, so it's impossible (default user permissions) for the log to be written there.
modified 11-Nov-11 8:51am.
|
|
|
|
|
Wait, why is the answer removed? It's an answer (albeit a wrong one), right? I think the answer shouldn't be removed as it can point out a practice that should be avoided. Dave, Can you please include the original answer in your message?
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
Nope, 'cause I can't see it either.
|
|
|
|
|
If you edit the answer you gave, it should give you the message that the user posted. This has worked for me in the past.
|
|
|
|
|
|
Windows provides special places, see here[^].
|
|
|
|
|
Generally recommended ... your app should have a folder under the common application data folder for certain users and/or all users. App data folders are usually created by their installers and have their permissions set appropriately for whatever access is required (read write etc.). You should always use the system functions to retrieve the locations of the root special folders (System.Environment.GetFolderPath(), SHGetFolderLocation(), SHGetKnownFolderIDList()) since the paths vary on Windows versions and users can move them.
Folders of interest for (local (non-roaming)) app data:
System.Environment.GetFolderPath(LocalApplicationData)
(Win32 Shell APIs FOLDERID_LocalAppData SIDL_LOCAL_APPDATA)
System.Environment.GetFolderPath(CommonApplicationData)
(Win32 Shell APIs FOLDERID_ProgramData/CSIDL_COMMON_APPDATA)
Mark Salsbery
|
|
|
|
|
Hi.
I want to know how the Google Search Algorithm calculates the information necessary to rank a website. Like, how does it measure inbound/outbound links links, how many times it has been shared on Facebook/Twitter, etc.
The only way I see it is to search every website on the internet, and then write all the outbound links, and then do bunch of math to go through all websites and rank the inbound links. But that would be toooo inefficient.
I'm not sure how it is done, I had a cool project in mind, but I am looking for a more efficient approach than the one I wrote above.
Could please guide me in the right direction?
Thanks!
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson "Why is it drug addicts and computer afficionados are both called users?" - Clifford Stoll
|
|
|
|
|
google "page rank algorithm"
There's a powerpoint presentation, one of the first hit that discuss that.
In short, it works by working graphs and weights and minimum distance and other stuff like that.
and more info on http://en.wikipedia.org/wiki/PageRank[^].
Watched code never compiles.
|
|
|
|
|
Hi,
I am wondering why I am getting this warning in my C# WinForm application in Visual Studio 2010?
Warning 1 A reference was created to embedded interop assembly 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\Accessibility.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Windows.Forms.dll'. Consider changing the 'Embed Interop Types' property on either assembly. Smart PBX Logger
Thanks,
jassim
|
|
|
|
|
|
but I guess it's referring to the accessibility.dll
do i really need ti in my project? is it added by default?
|
|
|
|
|
I try it but not much helpful. please send any other links
|
|
|
|
|
... edit #1 ... supplied link to critique of System.ComponentModel by SA Kruyakov as mentioned in text ...
Context: WinForms .NET 4.0 Client FrameWork, VS 2010 Pro
The goal of this question: to find a way to use a Static generic list containing instances of a non-static class to DataBind to a ListBox.Items Collection ... so the collection is dynamically updated ... without relying on using the BindingList Type in System.ComponentModel.
Background:
Back in 2007, Frans Bouma wrote[^]:List<T>doesn't raise an event that something was changed inside it,
as it doesn't implement IBindingList. This thus means that the bound
control can't 'observe' the datasource, so it can't know if something
changed inside List<t>. Since then, I've seen code examples where it looks like a generic List was rather easily set as the DataSource for ListBox, and I assumed the "barrier" that FB described in 2007 had been removed. Such as: [^].
And now:
Well today, I created a static class that holds a static generic list of a certain non-static class: like so:
public static class People
{
public static List<Person> ListOfEverybody;
public static Person CurrentPerson;
public static bool IsPersonAlreadyEntered;
static People()
{
ListOfEverybody = new List<Person>();
}
public static void AddPerson(string pName)
{
IsPersonAlreadyEntered = ListOfEverybody.Exists(prsn => prsn.PersonName == pName);
if (IsPersonAlreadyEntered) return;
CurrentPerson = new Person(pName);
}
} I set up the non-generic class 'Person with a Public Property I thought appropriate to use in data-binding, and a ToString over-ride:
public class Person
{
public string PersonName { get; set; }
public Person(string newPersonName)
{
PersonName = newPersonName;
People.ListOfEverybody.Add(this);
}
public override string ToString()
{
return this.PersonName;
}
} Results:
To sum it up, all my experiments in trying to bind a ListBox on a Form to the static ListOfEveryBody<person> in the static class People, so that the ListBox contents are updated as new entries are added ... using every combination of reasonable entries for DataSource, DisplayMember, ValueMember, fail.
My experiments with the newer 'BindingSource' component ... fail.
And then, a "bloody solution:"
Finally I trotted out the 'BindingList' from System.ComponentModel (the Library of which Sergey Kruyakov is very critical[^]), which Bouma had mentioned, and got that working to dynamically update the ListBox Items.
However, BindingList does not support the very nice System.Collections.Generic '.Exists' function, which I find so handy.
So I ended up maintaining parallel Lists, one BindingList<Person>, and one List<Person> which really takes away that mint-fresh-all-over feeling I crave
I'm thinking there must be a way to databind a generic List that happens to be static to a ListBox's Items so it is dynamically updated that's much more "freshy."
Appreciate any suggestions.
thanks, Bill
"Last year I went fishing with Salvador Dali. He was using a dotted
line. He caught every other fish." Steven Wright
modified 11-Nov-11 1:11am.
|
|
|
|
|
Maybe write your own? Wrapping the List<Person> and raising events as needed?
|
|
|
|
|
Thanks for your reply; there are several simple solutions. Like exposing the ListBox on the Form via a Public Property, and just adding to its Items Collection in the constructor of the 'Person Class.
But, I am very curious to know if there is another direct way to get the kind of binding that (until now) I assumed was pretty simple to do.
edit ... and that curiosity to understand the why ... and the broader implications ... and to, hopefully, get some 'best practice' ideas, and 'food for further thought' ... not just get a "quick fix" ... was my criterion for posting this here, rather than C# QA.
best, Bill
"Last year I went fishing with Salvador Dali. He was using a dotted
line. He caught every other fish." Steven Wright
modified 9-Nov-11 11:20am.
|
|
|
|