|
If you still have not figured it out, the .Add overload you're using expects the URi of your .xsd file, and not the file's contents as a string.
It compiles, because there is not type mismatch, obviously.
All you can do is stream the contents of your .xsd, then feed it to an XmlReader and then pass that XmlReader as your second parameter of .Add's next overload.
That should help, hopefully.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi Greg,
I think I should have been more precise. I knew I was passing the wrong data type to the .Add method. My problem was converting my string into a valid data type that the .Add will take.
At the end I am doing as follows:
StringReader sr = new StringReader(ClassLibrary1.Properties.Resources.jobs);
XmlSchema schema = XmlSchema.Read(sr,null);
sr.Close();
xss.Add(schema);
Anyway, thanks for your post!
|
|
|
|
|
i have problem for resizing of selected image.
|
|
|
|
|
|
Please elaborate on your requirement. If you mean to resize or edit icon or Bitmap, Then you can open it in Visual studi editor itself and do it.
|
|
|
|
|
I have to find the code blocks from the given code using Regex in C#.
e.g. I have to find the For loop block from the following code
For A in 1..10 Loop stmt1; For C in cur_op Loop stmt2; end loop; end loop; For T in 4..8 loop stmt3; end loop;
I want to retrieve the code blocks as
For A in 1..10 Loop stmt1; For C in cur_op Loop stmt2; end loop; end loop;
and
For T in 4..8 loop stmt3; end loop;
Can anyone suggest me any Regex for this?
Thanks.
|
|
|
|
|
what about -
"For + in + Loop +;"
im not 100% thou
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
|
If you realy think so, why dont u do it and tell me the answer?
|
|
|
|
|
hi dear friends
i wnat details in sqlconnect to C# ............ how can i connect sql2005
|
|
|
|
|
can you please reformulate?
|
|
|
|
|
First try a sensible subject, then go to here[^]
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
In c# code similar to the windows task manager functionality and when i'm trying to reach some processes
like sqlserver a runtime error appears(access is denied)
how i can reach this problem?
|
|
|
|
|
Hi,
if you are trying to change a process that is not yours (SQL Server owns to a service account by default) Windows will block your activities.
For example: try to change the priority of SQL Server via Taskman, and you'll see.
AFAIK there's no work arround. It's not a problem in C# but in Windows.
Bye,
monsta
|
|
|
|
|
In my code:C#,
when i'm trying to reach to the starttime or make killing to some processes like sqlserver, an error msg appear(access denied)
but
when i make that through windows task manager which already come with windows, no error occur.
|
|
|
|
|
You can't kill processes you don't have access to. You are the weakest link, goodbye.
|
|
|
|
|
Hi,
did you try, to set the priority (right click in Windwos Taskman)? I'm running here an SQL Express 2005 under a service account. I'm not able to change the priority, because therefore I must have the permissions to do it.
I could end the task, but that's NOT the same.
Kind regards
|
|
|
|
|
I have an application that writes any data it receives on a port to a file. The files have the date appended to them which means I have to keep an eye out for a new day to roll around.
At present I'm using this little bit of code...
DateTime today = DateTime.Now;
if (!(today.Date == DateTime.Now.Date))
{
today = DateTime.Now;
}
...which is straight forward enough. I am just wondering if there is a better (more efficient) means to know when the clock rolls over to a new day? As it is, I'm running that bit of code immediately before EVERY file write, and change the file name as needed. For now, its not an issue take the time to do things this way, but as my incoming data load increases I can see where streamlining is going to become an issue.
Any suggestions?
---------------------------------------------
Help... I'm embedded and I can't get out!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler
|
|
|
|
|
You could set up a timer event (or a BackgroundWorker object) that trips at midnight. The only semi-tricky part is determining the first interval to fire at (midnight - the current time), and then for every other following interval, just add 1 day to the current time.
If you setup a BackgroundWorker object to do this, you should make sure it supports cancellation, and put in a loop that checks the time every few seconds (so it can respond to the cancellation request).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
If you look at the Logging Enterprise Library from Microsoft, one of the TraceListeners it supports is a "RollingFlatFileTraceListener" - this has a setting to make it roll over to a new file at midnight (as well as other options like at xxxKb filesize)
|
|
|
|
|
Thanks for that... I didnt even know the Enterprise Library existed.
I have been taking a look at on off moments the past couple days, learning curve is a bit high for me to make use of it for what I'm presently working on; however, it is something I can make good use of in the near future (much more than just the file listener at that!).
---------------------------------------------
Help... I'm embedded and I can't get out!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler
|
|
|
|
|
Hey.
I am having a program where I am navigating a site, but the program continiues before the site is done loading, which means I get errors in the program.
I have tried:
wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(
delegate
{
//MyCode
}
);
But the program still contiunues, and then returns back to that function it is done loading, and that still gets me error.
I also tried
private void Navigate2(String address)
{
if (String.IsNullOrEmpty(address)) return;
if (address.Equals("about:blank")) return;
if (!address.StartsWith("http://") &&
!address.StartsWith("https://"))
{
address = "http://" + address;
}
try
{
webBrowser1.Navigate(new Uri(address));
}
catch (System.UriFormatException)
{
return;
}
}
But that aint waiting neither for the site to finish loading.
Can anyone help me please 
|
|
|
|
|
you may use ProgressChanged event, and check for e.CurrentProgress and e.MaximumProgress
Calin
|
|
|
|
|
Thx very much.. I used these functions you mentioned and then a global variable..
private void Navigate2(String address)
{
if (String.IsNullOrEmpty(address)) return;
if (address.Equals("about:blank")) return;
if (!address.StartsWith("http://") &&
!address.StartsWith("https://"))
{
address = "http://" + address;
_loaded = false;
webBrowser1.Navigate(address);
webBrowser1.ProgressChanged += new WebBrowserProgressChangedEventHandler(webBrowser_ProgressChanged);
while (_loaded == false)
{
Wait(100);
}
return;
}
}
private void webBrowser_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
{
siteLoading.Value = (int)e.CurrentProgress;
if (e.CurrentProgress >= e.MaximumProgress)
{
Wait(200);
_loaded = true; ;
}
}
|
|
|
|
|