| Microsoft Visual C# 2005 - missing watch window |
|
 |
Index ‹ DotNet ‹ Visual C#.Net
|
- Previous
- 1
- Dotnet >> Formating a text boxI am being very dumb... I am coverting an invoice value to a decimal and
displaying the result on a VB.net 2003 form. However, I only want to display
the result to 2 decimal places and I am struggling to it - sorry for such an
easy question!
Can somebody advice me how to achieve this?
--
Thanks
Bill Partridge
- 2
- Visual C#.Net >> KeyPreview now useable? (VS 2005)I have always found the form-level KeyPreview feature near useless, as
there was a bug that allowed ComboBoxes to ignore it. In VS 2005 I've
confirmed that it now woks in Combos. Is there anything else to be
concerned about, or can we now use this to our heart's content when we
want to pre-process input?
Bob
- 3
- Visual C#.Net >> Programmatically disabling Windows Control EventsHi
I wanted to programmatically disable events like SelectedIndexChanged without
using a boolean flag, which indeed I find a quick and dirty solution. So, I
found a
piece of code that do this more elegant:
* How to disable event in C#?
Link: http://tinyurl.com/alsge
Group: microsoft.public.dotnet.framework.compactframework
But I saw it is limited to ComboBoxes and to the SelectedIndexChanged Event
and
I want to generalize it to an object of type control and to every possible
event. To
give you an idea, I will post some of my ugly code:
public static EventHandler DisableSelectedIndexChanged(Control control)
{
FieldInfo fieldInfo;
object fieldObject;
EventHandler handler = null;
fieldInfo = control.GetType().GetField("SelectedIndexChanged",
BindingFlags.Instance | BindingFlags.NonPublic);
if (fieldInfo != null)
{
fieldObject = fieldInfo.GetValue(control);
if (fieldObject is EventHandler)
{
handler = (EventHandler)fieldObject;
//This is the part I want to avoid
if (control is ComboBox)
((ComboBox)control).SelectedIndexChanged -= handler;
else if (control is ListBox)
((ListBox)control).SelectedIndexChanged -= handler;
else if (control is ListView)
((ListView)control).SelectedIndexChanged -= handler;
else if (control is TabControl)
((TabControl)control).SelectedIndexChanged -= handler;
}
}
return handler;
}
Is it possible to avoid the casting and get a pointer to the
SelectedIndexChanged
property, then apply the -= operation over it? How? As I could understand,
FieldInfo.GetValue(control) only returns the handler, but not the
SelectedIndexChanged property.
Thanks in advanced,
Josef
- 4
- Visual C#.Net >> ArrayList.RemoveAt(i)Hi All,
I've done the same things for another array list like resetting the
datasource and its working fine but this time for a separate case i still
get the same error "index out of range"
And like before, the arraylist that is being binded is deleting correctly
from 4 items down to 3 etc. Do anyone have any ideas?
Thanks in advance
Alex Ting
""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
news:Y8BBI8DpDHA.1544@cpmsftngxa06.phx.gbl...
>
> Hi Alex,
>
> You should set DataGridTableStyle's MappingName to "ArrayList", then set
> DataGridColumnStyle's MappingName to Arraylist's public property.
> When deleting the arraylist member, you should refer to the
> CurrencyManager(Manages the collection of BindingManagerBase objects )
> which can get from BindingContext item.
> You should decrease CurrencyManager.Position property.
> Then, you can delete an item of arraylist and update the CurrencyManager.
>
> There is a sample project(You should download the entire project from a
> link in this article) in the post I last replied you. It provides you a
> detailed implementation of operating the Arraylist databinding. This
sample
> project works well on my machine, and I think it will meet your need
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>
> --------------------
> | From: "Alex Ting" <ating@learningfast.com>
> | References: <OaUw5A3nDHA.392@TK2MSFTNGP11.phx.gbl>
> <MhzPQQ3oDHA.2624@cpmsftngxa06.phx.gbl>
> | Subject: Re: ArrayList.RemoveAt(i)
> | Date: Thu, 6 Nov 2003 13:34:30 +1100
> | Lines: 285
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> | Message-ID: <e81VU6ApDHA.964@TK2MSFTNGP10.phx.gbl>
> | Newsgroups: microsoft.public.dotnet.languages.csharp
> | NNTP-Posting-Host: learningfast2.learnfast.monash.edu.au 130.194.247.2
> | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
> | Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.csharp:197066
> | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
> |
> | Hi Jeff,
> |
> | Thanks for your reply.
> |
> | the getQuestions simply returns the arrayList
> |
> | public Learningfast.QGM.QuizList getQuestions()
> |
> | {
> |
> | return this.myQuestions;
> |
> | }
> |
> | The mapping name is set to this but this is still not working. I even
set
> | the mapping name to "ArrayList" but to no avail.
> |
> | Thanks in advance.
> |
> | Alex Ting
> |
> |
> | ""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
> | news:MhzPQQ3oDHA.2624@cpmsftngxa06.phx.gbl...
> | >
> | > Hi Alex,
> | >
> | > Sorry for letting you wait for so long time.
> | > I think your code snipet is not integrated. There is nothing code
> related
> | > to getQuestions() method.
> | > But I still can give you some suggestion.
> | > For datagrid to bind to the arraylist, you should set the MappingName
> | > property to "ArrayList" not others. This rule can be found in MSDN
> | document
> | > in DataGrid(WinForm).
> | > I think if you set the correct binding, the datagrid will reflect the
> | > source arraylist correctly.
> | >
> | > For a sample of how to bind arraylist to datagrid, you can refer to:
> | > http://www.syncfusion.com/FAQ/WinForms/FAQ_c43c.asp#q818q
> | >
> | > If you still have anything unclear, please feel free to let me know.
> | >
> | > Best regards,
> | > Jeffrey Tan
> | > Microsoft Online Partner Support
> | > Get Secure! - www.microsoft.com/security
> | > This posting is provided "as is" with no warranties and confers no
> rights.
> | >
> | > --------------------
> | > | From: "Alex Ting" <ating@learningfast.com>
> | > | Subject: ArrayList.RemoveAt(i)
> | > | Date: Fri, 31 Oct 2003 16:30:57 +1100
> | > | Lines: 201
> | > | X-Priority: 3
> | > | X-MSMail-Priority: Normal
> | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> | > | Message-ID: <OaUw5A3nDHA.392@TK2MSFTNGP11.phx.gbl>
> | > | Newsgroups: microsoft.public.dotnet.languages.csharp
> | > | NNTP-Posting-Host: learningfast2.learnfast.monash.edu.au
130.194.247.2
> | > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
> | > | Xref: cpmsftngxa06.phx.gbl
> | microsoft.public.dotnet.languages.csharp:195620
> | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
> | > |
> | > | Hi Everybody,
> | > |
> | > | I have an issue about deleting an object from an arrayList.
> | > |
> | > | I've bounded a datagrid using this code
> | > | where it will first run through all of the code in loadQuestions()
and
> | > bind
> | > | a arrayList to the datagrid.
> | > |
> | > | private void BindQuestions()
> | > |
> | > | {
> | > |
> | > | dataGridQuestions.DataSource= this.AppQuiz.getQuestions();
> | > |
> | > | this.toolBarBtnSave.Enabled=true;
> | > |
> | > | this.toolBarBtnDel.Enabled=true;
> | > |
> | > | }
> | > |
> | > |
> | > |
> | > | public void loadQuestions()
> | > |
> | > | {
> | > |
> | > | this.BindQuestions();//this.AppQuiz.getQuestions();//AppQuiz();
> | > |
> | > | if(this.DataGridSet==false)
> | > |
> | > | {
> | > |
> | > | DataGridTableStyle gs = new DataGridTableStyle(); // gs =
Grid
> | > Style
> | > |
> | > |
> | > | gs.MappingName = AppQuiz.getQuestions().GetType().Name;
> | > | //dummyDataArr.GetType().Name;
> | > |
> | > | gs.AllowSorting = true;
> | > |
> | > | gs.AlternatingBackColor = System.Drawing.Color.AntiqueWhite;
> | > |
> | > |
> | > | DataGridTextBoxColumn cs2 = new DataGridTextBoxColumn();
> | > |
> | > | cs2.MappingName = "QuestionID";
> | > |
> | > | cs2.HeaderText = "No.";
> | > |
> | > | cs2.Alignment = HorizontalAlignment.Left;
> | > |
> | > | cs2.Width = 33;
> | > |
> | > | cs2.ReadOnly = true;
> | > |
> | > |
> | > | gs.GridColumnStyles.Add(cs2);
> | > |
> | > |
> | > | DataGridBoolColumn cs = new DataGridBoolColumn(); // cs =
> Column
> | > | Style
> | > |
> | > | cs.MappingName = "Publish";
> | > |
> | > | cs.HeaderText = "Publish";
> | > |
> | > | cs.Width = 75;
> | > |
> | > | gs.GridColumnStyles.Add(cs);
> | > |
> | > | cs = new DataGridBoolColumn();
> | > |
> | > | cs.MappingName = "Required";
> | > |
> | > | cs.HeaderText = "Mandatory";
> | > |
> | > | cs.Width = 75;
> | > |
> | > | cs2.ReadOnly = true;
> | > |
> | > | gs.GridColumnStyles.Add(cs);
> | > |
> | > | cs2 = new DataGridTextBoxColumn();
> | > |
> | > | cs2.MappingName = "QuestionType";
> | > |
> | > | cs2.HeaderText = "Question Type";
> | > |
> | > | cs2.Alignment = HorizontalAlignment.Center;
> | > |
> | > | cs2.Width = 80;
> | > |
> | > | cs2.ReadOnly = true;
> | > |
> | > | gs.GridColumnStyles.Add(cs2);
> | > |
> | > | cs2 = new DataGridTextBoxColumn();
> | > |
> | > | cs2.MappingName = "Ask";
> | > |
> | > | cs2.HeaderText = "Question";
> | > |
> | > | cs2.Alignment = HorizontalAlignment.Left;
> | > |
> | > | cs2.Width = 255;
> | > |
> | > | cs2.ReadOnly = true;
> | > |
> | > | gs.GridColumnStyles.Add(cs2);
> | > |
> | > | dataGridQuestions.TableStyles.Add(gs);
> | > |
> | > |
> | > | }
> | > |
> | > | panelDgQuestions.Show();
> | > |
> | > | panelSplash.Hide();
> | > |
> | > | }
> | > |
> | > |
> | > |
> | > | And then after that, they can delete a row from the datagrid. Then
> this
> | > | function is called
> | > |
> | > |
> | > |
> | > | /// <summary>
> | > |
> | > | /// this will remove the questions and then shuffle up all the
> questions
> | > | after it
> | > |
> | > | /// </summary>
> | > |
> | > | /// <param name="questionID">question ID to remove</param>
> | > |
> | > | public void removeAndShuffle(int questionID)
> | > |
> | > | {
> | > |
> | > | for(int i=0; i< this.myQuestions.Count; i++)
> | > |
> | > | {
> | > |
> | > |
> | if(((Learningfast.QGM.Question)this.myQuestions[i]).QuestionID
> | > | == questionID)
> | > |
> | > | {
> | > |
> | > | this.myQuestions.RemoveAt(i);
> | > |
> | > | }
> | > |
> | > | }
> | > |
> | > | }
> | > |
> | > |
> | > |
> | > | In debug mode, for example if there were 2 rows, it is now 1 row and
> | > | everything seems fine, but when i rebind the datagrid with the
> arraylist
> | > | after an object has been removed,
> | > |
> | > | private void BindQuestions()
> | > |
> | > | {
> | > |
> | > | dataGridQuestions.DataSource= this.AppQuiz.getQuestions();
> | > |
> | > | this.toolBarBtnSave.Enabled=true;
> | > |
> | > | this.toolBarBtnDel.Enabled=true;
> | > |
> | > | }
> | > |
> | > | Mind you it does not run through the initializing statements of the
> | > | datagrid, it just rebinds the datasource. And then at this point
when
> | the
> | > | datagrid is meant to be displayed, it gives me an error index [index
> | > number
> | > | that was deleted] is out of bounds.
> | > |
> | > | Can someone please tell me whats happening? I've read up in several
> | cases
> | > | and usually this means that I'm trying to bring up the object that
was
> | > | deleted but I'm just changing the datasource to the amended
arraylist.
> | > Could
> | > | this have to do with my existing datagrid where i'm not initializing
> it
> | > | again? because I've tried that and it also brings up an error saying
> | that
> | > | i'm using the same "mapping name"
> | > |
> | > | Thanks in advance.
> | > |
> | > | Kind Regards
> | > |
> | > | Alex Ting
> | > |
> | > |
> | > | ---
> | > | Outgoing mail is certified Virus Free.
> | > | Checked by AVG anti-virus system (http://www.grisoft.com).
> | > | Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/2003
> | > |
> | > |
> | > |
> | >
> |
> |
> | ---
> | Outgoing mail is certified Virus Free.
> | Checked by AVG anti-virus system (http://www.grisoft.com).
> | Version: 6.0.536 / Virus Database: 331 - Release Date: 3/11/2003
> |
> |
> |
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003
- 5
- Dotnet >> PDF's Internet Explorer 7Ever since I installed IE 7 PDF's on several web sites do not appear for me
to print or download. Is there a setting I need to adjust. This happens only
on a few web sites
- 6
- Net Framework >> Having trouble deploying Custom User Control to a container ...If I develop a user control that is made from intrinsic windows controls such
as text box, etc, I can successfully deploy it to the the browser and see it
instantiated.
but if I add a third party control to the custom control, then I have
difficulty instantiating it.
I guess this has to do with .Net framework security.
I have done my best to change the security policies on the local computer to
allow the Custom User Control to run, but had no success.
I have dveloped and deployed the user control by following the steps
provided at the following URL:
http://www.c-sharpcorner.com/Code/2003/March/ActiveXInNet.asp
Is there any way I can develop a user control in .Net that includes a third
party control and instantiate into a container?
All helpful comments will be appreciated.
Thanks,
Mehran Sedaghatpour.
- 7
- Net Framework >> Nullable boolean true on webservice response comes across as nullHello all,
I'm working on a web app that we converted over to asp 2.0 recently and
here's the issue I ran into:
We use a java webservice to retrieve data and display this data to the user.
This was working in 1.1 and nothing changed around this particular webservice
call on either side after the switch to 2.0. The webservice response is an
array of value objects and the value object contains a boolean. I intercepted
the response with Fiddler and verified that the boolean was set to either
true or false on all the vo's in the array. But after the response object was
created and I could look at it in the code while debugging, the (nullable)
boolean field in every vo in the array was null.
To fix this temporarily, I had the webservice provider change the boolean
field to a 'NullableBoolean' class that contained a boolean value - this way,
the correct value came across and I could work with it.
I'm not sure if this is helpful, but there's one more detail I noticed -
The xml doc I intercepted with Fiddler looks something like this
('processed' is the boolean variable):
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"...>
<env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
...
<responseVos...>
...
<ResponseVo ...>
...
<processed href="#ID_4"/>
...
</ResponseVo>
...
</responseVos...>
...
<xsd:boolean xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:type="xsd:boolean" id="ID_4">true</xsd:boolean>
...
</env:Body>
</env:Envelope>
This is working for now but I think I shouldn't have to have my webservice
provider fix my problem, right? Any help in solving this problem would be
greatly appreciated.
--
ak
- 8
- Visual C#.Net >> CollectionBase in Net1.1 and Collection in Net 2.0Hi,
I have some collections that inherit from CollectionBase in Net 1.1
In these collection I override the OnRemove, OnRemoveComplete, ...
I would like to to move them in Net 2.0 but in this version these protected
methods don't exist
What is the best way?
Thank's in advance
- 9
- Net Framework >> EMBEDDING images - System.Web.MailHi, I hope there is someone reading this that has the answer, Please Help!
I have the need to send a html email via asp.net. its easy enough to send
an html email and add attachments.
My question is, how to you set the Content-Location of each attachment in
the mail headers so that the images are embedded in the html email rather
than attached?
This is my code:
private void Page_Load(object sender, System.EventArgs e)
{
MailMessage objEmail = new MailMessage();
objEmail.From = aspnet@domain.com;
objEmail.Subject = "news flash ";
string body = "<html>.....
{some html code with images as <img src=\"news_r1_c1.jpg\"> ... etc
</html>";
objEmail.Body = body;
objEmail.Priority = MailPriority.Normal;
objEmail.BodyFormat = MailFormat.Html;
MailAttachment i1 = new
MailAttachment(Server.MapPath("images/news_r1_c1.jpg"));
MailAttachment i2 = new
MailAttachment(Server.MapPath("images/news_r1_c3.gif"));
MailAttachment i3 = new
MailAttachment(Server.MapPath("images/spacer.gif"));
MailAttachment i4 = new
MailAttachment(Server.MapPath("images/news_r4_c1.jpg"));
MailAttachment picture = new
MailAttachment(Server.MapPath("images/default.jpg"));
objEmail.Attachments.Add(i1);
objEmail.Attachments.Add(i2);
objEmail.Attachments.Add(i3);
objEmail.Attachments.Add(i4);
objEmail.Attachments.Add(picture);
string sendto = Request.Form["recipients"];
string[] recipients= sendto.Split(',',';');
foreach(string recipient in recipients)
{
objEmail.To = recipient.Trim();
SmtpMail.SmtpServer = "smtp.server,com";
try
{
SmtpMail.Send(objEmail);
}
catch (Exception exc)
{
Response.Write("Send failure: " + exc.ToString());
}
}
}
as said, html email is coming through fine, images are in email as
Attachments, but DON'T display inline with the page (even though the
attachments are named correctly corresponding to the image names in the HTML
(<img src="imagename.jpg"> where imagename.jpg is attached).
I have sent HTML emails with embedded images in Classic ASP using CDONTS
quite easily, i need to do the same in .NET!
[FYI code to attach in ASP is:
objMail.AttachURL server.MapPath("images/imagename.jpg"), "imagename.jpg"
]
a quick look at the message source shows this at the top of the part that
holds the binary information about the image, in the email source:
for the ASP version (that works) :
------=_NextPart_000_000A_01C3EF89.62C8CA30
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
Content-Disposition: attachment
Content-Location: news_r1_c1.jpg
in the ASP.NET version (doesn't show images inline)
------=_NextPart_000_005D_01C3F184.ECF34990
Content-Type: image/jpeg;
name="news_r1_c1.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="news_r1_c1.jpg"
notice how there is no Content-Location with the image name in the .NET
version, this is obviously needed to tell the mail client where the attached
images should be displayed in the HTML email.
Now does anyone know how to set this in the .NET mail object??
any help/leads in the right direction are appreciated.
The doesn't seem to be anywhere to set this property in the MailAttachment,
or MailAttachments.Add methods, and i couldn't find any answers in the docs
Please help
Thanks
Tim
PS. (although i'm using c#, vb code will do if you code in VB.NET)
- 10
- ADO >> MSDE and TransactionScopeI have a C# application that applys a set of scripts to a database to create
the structures. When each script is applied, I encapsulate the call within a
TransactionScope. Everything works fine on SQL Server 2000 sp4, 2005 sp1,
and Express 2005 sp1 databases.
On MSDE2000 SP4, I consistently get transaction timeouts on my scripts.
However, it is never the same script. These are the same scripts I use on
other database, so I am confident that the scripts themselves are fine.
Everything is running locally on one machine. MSDTC is running. I've tried
restarting the services, restarting the machines, and connection pooling
seems to be ok, and I'm running out of ideas to check.
Has anyone had a similar experience or can recommend something to check?
- [System.Data.SqlClient.SqlException] {"Import of MSDTC transaction
failed: XACT_E_NOTRANSACTION."} System.Data.SqlClient.SqlException
Number 8509
- 11
- ADO >> Problem with disable msde connection poolHello,
To resotre MSDE database, the connection pool must be disabled. I set
pooling=false in the connection string, i.e.,
SqlConnection conn = new SqlConnection("server=(local)\\NetSDK;
database=mydb; uid=sa; password=abc; pooling=false;");
It seems that the connection pool was not disabled. Here are the error
messages I got:
[Microsoft][ODBC SQL Server Driver][SQL Server]Exclusive access could
not be obtained because the database is in use.
[Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE DATABASE is
terminating abnormally.
Any ideas? Are there any other ways to disable the connection pool?
Any help would be appreciated!
Mandy
- 12
- ADO >> nvarchar Sql data typeHi
If the table column is defined as folows:
FullName nvarchar 20
Does this let me add a string of maximume 20 characters? or is it limited to
20 bytes length?
Thanks,
Ronen
- 13
- Net Framework >> Short display for long filenamesHello,
as most of you know, some programs that handle files have a "recent files"
feature, that is mostly a menu item within the file menu that shows the
last documents the user had opened. Visual studio .net gives you an
example.
This example shows as well that long filenames will be displayed shortened
to fit the menu item, e.g.
C:\Documents and settings\John Doe\My files\XYZ\document.xyz
might be displayed as
C:\Documents and settings\ ... \XYZ\document.xyz
As I would like to have this feature in my own brilliant and amazing
helloWorld-application, too, I'm wondering if there isn't a function in
the .net framework that returns the shorter version of a full path that
exceeds a specified length.
Of course, it is possible - actually for me - to parse the string for
myself, but I would not like to reinvent the wheel.
Just to prevent misunderstandings: I don't mean that kind of short filenames
returned by the GetShortPathName-API-function like "C:\Documn~1\John~1" ...
So: Did I overlook something in the .net documentation?
Regards Daniel
--
http://www.bolege.de
E-mails to specified address will NOT be read.
Please use db[at]bolege[dot]de instead.
- 14
- Visual C#.Net >> Access ModifiersHi,
Is it possible to declare a variable or array in the class that is
accessible to all the methods in the class? For the example below, I would
like to make the variable lnVar1 accessible to both methods m1 and m2 but I
am getting an error. Is there another way to do this?
Thanks
Roy
using System;
using System.Collections.Generic;
using System.Text;
namespace cClasses
{
class Program
{
static void Main(string[] args)
{
AA2.m1();
}
}
}
public class AA2
{
protected int lnVar1 = 0;
public static void m1()
{
Console.Write("M1 {0}", lnVar1);
}
public static void m2()
{
Console.Write("M2 {0}", lnVar1);
}
}
- 15
- Visual C#.Net >> BinaryReader munges dataI'm about to rip out what little hair I have left; I have a class that
uses a BinaryReader, and the data is getting munged. A subset of the
code follows; I've removed the parts that aren't relevant.
What's really strange is that it reads the file just fine until the
272nd call to the Read method of the class, at which point it begins
munging the data.
Any thoughts would be greatly appreciated; I've tried reading by byte,
as well as reading blocks, and it makes no difference.
-Kevin
public class HeaderStream
{
private const int c_BlockSize = 680;
private System.IO.BinaryReader str;
public HeaderStream(string path)
{
FileStream s = new FileStream(path,
FileMode.Open,
Read);
str = new BinaryReader(s);
}
public OWHeader Read()
{
byte[] buf = new byte[c_BlockSize];
int i;
i = str.Read(buf, 0, c_BlockSize);
if (i != c_BlockSize)
throw new EndOfStreamException(
String.Format(
"End of stream reached with bytes left to read"));
return new OWHeader(buf);
}
}
|
| Author |
Message |
Fernando211_6

|
Posted: Thu Sep 20 02:05:50 PDT 2007 |
Top |
Visual C#.Net >> Microsoft Visual C# 2005 - missing watch window
Could anyone tell me why I cannot bring up the watch window. MS help
says its there but no matter what I do, I cannot find any settings to
enable this debug missing menu item. Searched Google, asked others and
one other said he could not find it either. Usually MS says that you
need enterprise or whatever if a feature is missing but in this case
there is no comments - it just should be there!
Thanks,
Alistair.
DotNet403
|
| |
|
| |
 |
Ben

|
Posted: Thu Sep 20 02:05:50 PDT 2007 |
Top |
Visual C#.Net >> Microsoft Visual C# 2005 - missing watch window
On Thu, 20 Sep 2007 12:41:25 +1200, Alistair George wrote:
> Could anyone tell me why I cannot bring up the watch window. MS help
> says its there but no matter what I do, I cannot find any settings to
> enable this debug missing menu item.
Hello Alistair,
there is no menu item in my VS Professional either (though you can
probably configure that).
When I debug, the watch window shows automatically.
If not, press the keyboard short cut -- whilst debugging, won't work in
ediiting mode:
Default shortcut is ctrl + alt + w, then 2.
Does the watch window still not show up?
There are a couple of windows/dialogs VS doesn't seem to by default
provide a menu item for e.g "attach to process" (ctrl + alt + p) and
"Exceptions" (ctrl + alt + e)
Ben
|
| |
|
| |
 |
Alistair

|
Posted: Thu Sep 20 11:28:39 PDT 2007 |
Top |
Visual C#.Net >> Microsoft Visual C# 2005 - missing watch window
Ben Schwehn wrote:
> On Thu, 20 Sep 2007 12:41:25 +1200, Alistair George wrote:
>> Could anyone tell me why I cannot bring up the watch window. MS help
>> says its there but no matter what I do, I cannot find any settings to
>> enable this debug missing menu item.
>
>
> Hello Alistair,
>
> there is no menu item in my VS Professional either (though you can
> probably configure that).
>
> When I debug, the watch window shows automatically.
>
> If not, press the keyboard short cut -- whilst debugging, won't work in
> ediiting mode:
> Default shortcut is ctrl + alt + w, then 2.
> Does the watch window still not show up?
>
> There are a couple of windows/dialogs VS doesn't seem to by default
> provide a menu item for e.g "attach to process" (ctrl + alt + p) and
> "Exceptions" (ctrl + alt + e)
>
> Ben
Thank you Ben. I figured it out just before I went to bed last night -
but I'm pretty sure help does not specify that you have to be debugging.
That was the key - I was trying to find it in edit mode which is common
for other language compilers but not this one!
Al.
|
| |
|
| |
 |
Ben

|
Posted: Mon Sep 24 15:56:02 PDT 2007 |
Top |
Visual C#.Net >> Microsoft Visual C# 2005 - missing watch window
"Ben Schwehn" <EMail@HideDomain.com> wrote in message
news:uN09xV2%EMail@HideDomain.com...
> On Thu, 20 Sep 2007 12:41:25 +1200, Alistair George wrote:
>> Could anyone tell me why I cannot bring up the watch window. MS help
>> says its there but no matter what I do, I cannot find any settings to
>> enable this debug missing menu item.
>
>
> Hello Alistair,
>
> there is no menu item in my VS Professional either (though you can
> probably configure that).
Pretty sure there is, but it would be on the Debug menu, Windows popout
alongside "Memory", "Call Stack", and "Threads", not on the View menu which
has "Solution Explorer" and so forth.
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Visual C#.Net |
- Next
- 1
- 2
- Microsoft Project >> Automatically Adjust DurationHow do I set Project to automatically adjust Estimated duration to fit to the
times tasks actually took place?
I am also unable in several cases to tell Project that a task completed on a
certain date. It will either set an unwanted constraint, or tell me there's a
conflict and fail to adjust any other task accordingly. I have construction
projects that have the house being roofed after the customer has moved in!
I do apologize for asking so many questions on this board, but I definitly
need the help! Thank you.
- 3
- Net Framework >> .NET one way RemotingAs a client I am sending data using a OneWay method to a server.
What happens if the client is sending messages faster than the server can
consume them?
Who is responsible for holding the queue?
If the object sending is a WellKnownObjectMode.Singleton what happens if I
send another message before the last one completes?
And the same for a WellKnownObjectMode.SingleCall?
Is there any guarantee using IPC that the messages will get to the server in
the same order I sent them?
Ditto for TCP and HTTP?
Thanks
Tom
- 4
- Visual C#.Net >> Query re ADO.NET, constraints, relations, and cascading updates/deletesOne part of a customer project I'm working on involves what seem
like fairly straightforward updates to a set of related tables.
While I've developed software for a number of years (it only seems
like centuries on days like this <grin>), I'm new to C# and ADO.NET
and I'm running into problems with record deletions.
I (think I am) applying ForeignKeyConstraints correctly. I'm not
applying DataRelations (yet), but those _appear_ to be related to
record retrieval rather than record deletion. Yet my "Cascade"
Rules don't appear to be having the effect I want, that of deleting
child records relating to the parent (Employee) record I'm
attempting to delete.
My fallback is to do it myself: starting a transaction and then
"tree-walking" in my procedural code to delete child and grandchild
records. Is that my only choice? Or am I doing something obviously
wrong, omitting something critical, or simply performing the right
steps in the wrong order?
Any hints will be appreciated (including "it doesn't work in .NET
2003, wait for .NET 2005-or-RealSoonNow(tm)").
Rather than post a set of clips from about eight modules (so far),
let me lay out what I'm attempting to do and ask whether I seem to
at least be approaching the problem correctly.
----
Imagine I have a staff of employees, each with zero or more Phone
Numbers (office, home, cell, etc.) and zero or more Skills. Each
works on zero or more Projects, and each Project has zero or more
Deadlines:
Employees: Employee_ID (Primary Key, autoincrement),
Employee_Name, etc.
PhoneNumbers: Phone_Item_ID (Primary Key, autoincrement),
Employee_ID, Phone_Number, etc.
Skills: Skill_Item_ID (Primary Key, autoincrement),
Employee_ID, Skill_Description, etc.
Projects: Project_ID (Primary Key, autoincrement),
Employee_ID, Project_Name, etc.
Deadlines: Deadline_ID (Primary Key, autoincrement),
Project_ID, Deadline_Date, Deadline_Description,
etc.
The relationships are fairly straightforward (using [1:M] because I
can't find an "infinity" symbol on my keyboard):
Employees--[1:M on Employee_ID]--PhoneNumbers
Employees--[1:M on Employee_ID]--Skills
Employees--[1:M on Employee_ID]--Projects
Projects---[1:M on Project_ID]---Deadlines
I can load all of the tables from the database into a DataSet using
a set of OleDbDataAdapters, one per table. I can browse the
Employee table. But when I attempt to delete a row from the
Employee table, even my best attempts to date continue to yield an
error message equivalent to "The record cannot be deleted or changed
because table 'Skills' includes related records."
At startup, I load each table into my (one) DataSet 'dset':
// Set up the commands and TableMappings
da_em = new OleDbDataAdapter();
da_em.SelectCommand =
new OleDbCommand("SELECT * FROM Employees", conn);
cb_em = new OleDbCommandBuilder(da_em);
da_em.TableMappings.Add("Employees", "em");
(4 more similar sections of code, once for each remaining table)
// Fill the table Schema and Tables
da_em.FillSchema(dset, SchemaType.Mapped, "Employees");
da_em.Fill(dset, "Employees");
(4 more similar sections of code, once for each remaining table)
// Apply constraints
// Employees [1:M] Skills
fkc_em_sk = new ForeignKeyConstraint(
"Employees_OneToMany_Skills",
dset.Tables["em"].Columns["Employee_ID"],
dset.Tables["sk"].Columns["Employee_ID"]
);
fkc_em_sk.DeleteRule = Rule.Cascade;
fkc_em_sk.UpdateRule = Rule.Cascade;
fkc_em_sk.AcceptRejectRule = AcceptRejectRule.Cascade;
dset.Tables["sk"].Constraints.Add(fkc_em_sk);
(3 more similar sections of code, once for each remaining FK
constraint)
dset.EnforceConstraints = true;
conn.Close();
Later, when I'm attempting to delete an Employee record, I use the
following code:
// Following the Remarks section under "DataSet Class [C#]"...
// Issue Delete for current record
dset.Tables["em"].Rows[currentposition].Delete();
// Extract changes
DataTable dt = dset.Tables["em"].GetChanges();
if (dset.HasErrors) {
PgtCommon.PgtPopUpMsg("Errors in EditEmployee deletions");
}
// Use changes to update DataSet
**daem.Update(dt); // Apply this change via DataAdapter
dset.Merge(dt);
dset.Tables["em"].AcceptChanges(); // GONE
The ** line marks where the exception occurs.
For what it's worth, the deletion process works just fine when the
Employee records _don't_ have any child/grandchild records.
As I said, any clues will be appreciated.
Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)
--
Literature exists for the ordinary educated man, and any
literature that actively requires enormous training can be at best
of only peripheral value. Moreover, such a mood in literature
produces the specialist who only knows about literature. The man
who only knows about literature does not know even about
literature. -- Robert Conquest, "The Dragons of Expectation"
--
- 5
- ADO >> Ideas on storing and retriving files in a Windows ApplicationI'm looking for some ideas, I have a project to complete that has a
requirement to store just about ANY type of document. Most common documents
include Word, Excel, HTML, images, pdf, media files, etc. I was thinking of
storing these into SQL Server 2000 as image type but my delimma lays with
retrieval. I was thinking of using a Microsoft Web Browser control to
display the item to the user. This works ok for 2 reasons, 1. The browser
will open the appropiatte application to display the file and 2. I can just
use the Navigate(2) method to display the item. The problem with this I
don't want the requirement of storing the item to a file (filestream) before
displaying (Navigate needs somewhere to go). I was thinking of memoryStream
but I see no good examples (other than image files) on how to do this,
espcially on how to handle large files. Is this a good approach? Or should
I just stick with files stored on the server?
THANKS
--
Ken Beard
MCSD, MCP
- 6
- Dotnet >> Multi-parameter stored procedure (query in Access)Is it possible to use a multi-parameter query in .NET
Here's the method
Public Function SearchCatalog(ByVal searchString As String, ByVal allWords As String) As OleDbDataReade
' Create the connection objec
Dim connection As New OleDbConnection(connectionString
Dim command As New OleDbComman
' We guard agains bogus values here - if we receive anythin
' different than "TRUE" we assume it's "FALSE
If allWords.ToUpper = "TRUE" The
' Create and initialize the command object and search all word
command.CommandText = "SearchCatalogAllWords
command.Connection = connectio
command.CommandType = CommandType.StoredProcedur
Els
' Create and initialize the command object and search any word
command.CommandText = "SearchCatalogAnyWords
command.Connection = connectio
command.CommandType = CommandType.StoredProcedur
End I
' We eliminate separation character
searchString = searchString.Replace(",", " "
searchString = searchString.Replace(";", " "
searchString = searchString.Replace(".", " "
' We create an array which contains the word
Dim words() As String = Split(searchString, " "
' wordsCount contains the total number of word
Dim wordsCount As Integer = words.Lengt
' index is used to parse the list of word
Dim index As Integer =
' this will store the total number of added words
Dim addedWords As Integer =
' We allow a maximum of 5 word
While addedWords < 5 And index <
' We add the @searchWord parameters her
If addedWords < wordsCount The
addedWords +=
' Add an input parameter and supply a value for i
command.Parameters.Add("@searchWord" + addedWords.ToString, words(index)
Els
addedWords +=
' Add a blank input paramete
command.Parameters.Add("@searchWord" + addedWords.ToString, ""
End I
index +=
End Whil
' Open the connectio
connection.Open(
' Return a SqlDataReader to the calling functio
Return command.ExecuteReader(CommandBehavior.CloseConnection
End Functio
Here is the query
SELECT Product.ProductID, Product.Name, Product.Description, Product.SKU, Product.Price, Product.ImagePat
FROM Produc
WHERE (((Product.Name) Like "*"+[@searchWord1]+"*")) OR (((Product.Description) Like "*"+[@searchWord1]+"*"))AND (((Product.Name) Like "*"+[@searchWord2]+"*")) OR (((Product.Description) Like "*"+[@searchWord2]+"*")) AND (((Product.Name) Like "*"+[@searchWord3]+"*")) OR (((Product.Description) Like "*"+[@searchWord3]+"*")) AND (((Product.Name) Like "*"+[@searchWord4]+"*")) OR (((Product.Description) Like "*"+[@searchWord4]+"*")) AND (((Product.Name) Like "*"+[@searchWord5]+"*")) OR (((Product.Description) Like "*"+[@searchWord5]+"*"))
- 7
- Winforms >> System.Windows.Forms.WebBrowser and PDFI tried to show an pdf on the WebBrowser.
I use this code:
this.webBrowser1.Navigate(@"C:\Path\PDFName.pdf");
I get all the time this Error message as an pop-up:
An error has occurred in the script on this page
Line 2
Char 1
Invalid character
Code: 0
URL: file://C:\Path\PDFName.pdf
Do you want to continue running script on this page?
Have anyone an idea?
Tahnks a lot
mjeh
- 8
- Visual C#.Net >> Regasm.exe Interop problemI have a dll built with c# in VS.net and Register
for COM interop is set to true. This builds
fine on my xp development machine and
the dll output is used by a User defined
function in sql server. This all works
fine until I put the dll on a production server
(small business server) then register it
(without error) using regasm.exe. I get
an error message stating "The system cannot
find the file specified". The differences between
my two environments are VS.Net on my deveopment
machine and not on the SBS server and using
VS.net's build to output and register the dll as opposed
to regasm on the SBS Server. It is possible that
both machines have a different version of the framework
which I cant check from my current location.
Any Help greatly appreciated.
Simon
- 9
- Visual C#.Net >> PRB: Can not get UserControl/HTML/OBJECT to work on XP/SP2/IIS/IE6PRB: Can not get UserControl/HTML/OBJECT to work on XP/SP2/IIS/IE6
Please help,
I can not get my UserControl to work from a simple OBJECT tag in a simple
HTML web page on Windows XP with SP2 and IIS. I have made UserControls
before, but for whatever reason, XP/SP2/IIS/something is not letting the web
page run the UserControl, giving an error of "Object doesn't support this
property or method". Here are the steps to reproduce:
Step 1) In XP/IIS create a virtual directory (VD) that runs ONLY scripts (NO
EXECUTABLES).
Step 2) Make this simple HTML page and put it in the VD from above.
=====================
<html>
<body>
<object
id=objTest
classid="http:MyControl.dll#MyNamespace.MyControl"
VIEWASTEXT
>
</object>
</body>
<script language=javascript>
var objTest;
objTest = document.getElementById("objTest");
var csHello = objTest.RunTest("Hello");
alert(csHello);
</script>
</html>
=====================
Note that the OBJECT tag's classid is set with "http:" in the front. Trying
it without this will still generate the same error.
Step 3) Create a C# UserControl app called MyControl, with the namespace
"MyNamespace", and add a method called "RunTest" to take a string as its only
parameter, and return the same string.
=====================================
Something about IE, XP, IIS is preventing the script from getting the
"RunTest" method. What can I do.
- 10
- ADO >> GUIDsThis is a multi-part message in MIME format.
------=_NextPart_000_0114_01C3B8DB.576D5F00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I usually use numerics with a random number generator for my unique ID =
fields in my tables, however I have an instance where I would like to =
use GUIDs (since this key will never be used or seen by the end user). =
Here is the start of my code:
Dim myGuid1 As New Guid()
JrEventID =3D myGuid1.ToString
txtEventID.Text =3D JrEventID
How do I generate a new GUID? Is is a simple process?
Thanks for the information.
Brad
------=_NextPart_000_0114_01C3B8DB.576D5F00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>I usually use numerics with a random =
number=20
generator for my unique ID fields in my tables, however I have an =
instance where=20
I would like to use GUIDs (since this key will never be used or seen by =
the end=20
user). Here is the start of my code:</FONT></DIV>
<DIV>
<P><FONT face=3DArial size=3D2> Dim myGuid1 As New=20
Guid()</FONT></P>
<P><FONT face=3DArial size=3D2> JrEventID =3D=20
myGuid1.ToString</FONT></P>
<P><FONT face=3DArial size=3D2> txtEventID.Text =3D=20
JrEventID</FONT></P>
<P><FONT face=3DArial size=3D2>How do I generate a new GUID? Is is =
a simple=20
process?</FONT></P>
<P><FONT face=3DArial size=3D2>Thanks for the information.</FONT></P>
<P><FONT face=3DArial size=3D2>Brad</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_0114_01C3B8DB.576D5F00--
- 11
- ADO >> NewRowBuilderHi,
We want different row types at the same time in a DataTable. The idea behind
this is to support a kind of inheritance in a table. To do this, we had
overridden the NewRowFromBuilder method. Then we select the row type
construction using a special column that contains the type of the database
record type. All row type inherit from DataRow, but they have a common set
of columns and additional columns according to each type. Top base class is
TPersons
TCustomers and TEmployees inherit from TPersons
TSpecializedCustomers inherits from TCustomers.
Actually we have succeeded using the following code at the Fill time. When
we the Merge and the GetChanges method, will get the following message "This
row has been removed from a table and does not have any data. BeginEdit()
will allow creation of new data in this row." at the line A. I know that
methods called by Fill are not the same as the GetChanges method.
protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
TPersonsRow newBaseRow = new TPersonsRow(builder);
(A) string RowType = (string)newBaseRow[columnRXClassType];
if (RowType == "TEmployees") { return new TEmployeesRow(builder); }
if (RowType == "TCustomers") { return new TCustomersRow(builder); }
if (RowType == "TSpecializedCustomers") { return new
TSpecializedCustomersRow(builder); }
return newBaseRow;
}
I just want a idea of how I can overcome this issue. We already did
implement the same concept in earlier version of ADO and now we are trying
to migrate to ADO.NET. But we are not sure, the thing is we cannot migrate
if we cannot support inheritance like we have already done.
Thanks!
- 12
- Dotnet >> Cannot create a asp dot net projectI have 2 developper machine running visual studio 2003 and Windows
2000.
On the first machine (Machine A) I may create a new asp project without
problem. On the second (Machine B) I cannot create a new project.
Visual Studo create the project but not the initial files and freezes.
But I may create a new project from Machine A using the web server of
machine B.
I have checked the access rights of both servers, the access rights on
directory wwwroot and inetpub.
Everything seems the same.
Thank you for help
Patrick
- 13
- ADO >> about typed datasets (conceptual question)hi ,
I am using ado.net with typed datasets and typed datatables
my question is about how to handle child / parent type tables with datasets.
For instance say that I have 2 tables with columns :
table Topic: (parent table)
TopicId
TopicName
CreateDate
table Message : (child table)
MessageId
TopicId
Message
CreateDate
When I need to use these 2 tables from the asp.net code I am using
databinding to bind data to a datagrid
My problem starts here because :
When I need these two tables in joined way . (say that I am listing messages
in the datagrid and I need TopicName in each row)
In classic way , it is easy join these two tables and write the necessary
databinding code.
select Message.*, Topic.TopicName from Message inner join Topic on
Message.TopicId=Topic.TopicId
But when I use typed datasets How should I fill these two tables ? ( You
can say that fill these 2 tables seperately but what if I need only the
TopicName column ? isn't it a performance decrease for the system ? do I
have to ignore it ? ) Also I would like to benefit from typed dataset
architecture.
Is there any good document or web page address about this issue ? How should
I write stored procedures ?
- 14
- Net Framework >> Timer control vs Timer classI included a timer control in my C# project, I got the following 2 events
1. Disposed
2. Tick
I included the timer class programatically in the same C# project and I got
the following events
1. Disposed
2. Elapsed
I am stumped..:-( whats going on here? I have framework 1.1 with VS.NET
2003
VJ
- 15
- Winforms >> How can one select from overlapped panels in the form design View?I am building a Windows Form App that has a splitter in the client area,
treeview on the left, and panels on the right. Different classes of tree
nodes need different views. How can I cause the one I want to work on (say
add or remove a control) to pop to the top of the z order in the design
view? I have tried about everything I can think of, without success. Bring
to top and send to bottom do not seem to do what I expect. Google revealed
nothing. Any help would be much appreciated.
|
|
|