|
Thanks for answering. But, there is no option for hexadecimal, so I can't uncheck it.
I'm working with Visual Studio 2005.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
It's there. It's called Hexidecimal Display.
|
|
|
|
|
Ok, I found it. But it's not directly available in the popmenu displayed after pointing a variable. I did it from the 'Watch' window.
Thanks !
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
Try this:
As you're debugging, go to the locals (or watch) panel. Select a variable (name, value, type) and right click. It lets you toggle the hex display.
|
|
|
|
|
It works this way. Thanks for replying !
Pat.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
I am in the process of creating a program that needs to extract the below data from an ASP then populate a dataGridView. I only need to extract certain information but not all information. AS an example I need to look for "TCatalog:" and then the text after wich could be "OK" or Off-Line". What I don't need is the Overhead or the Heap Error Code.
TCatalog: OK<BR>DATSVR: OK<BR>Server IP: xxx.xxx.xxx.xxx<BR>Server Port: xxxx<BR>Socket Count: 1<BR>CC/ProgID: XX/XXXX<BR>Site Style: STD<BR>Program Name: Program Name<BR>Client Name: comapny Name<BR>Catalog Started at: 7/30/2007 10:33:42 AM<BR>Total Sessions: 8<BR>Current Sessions: 19<BR># Orders Received: 0<BR>Total Amount of Orders: 0.00<BR>Last Logged Request: 7/30/2007 10:33:42 AM<BR># Errors Logged: 17<BR># DB Errors Logged: 0<BR>Customized Pages: CartCheckOut.Asp,Main.Asp
<BR>Last Published: 07/13/07 10:00 by XXX<BR>Data Updated: 07/13/07 10:00 by CMG<BR>Memory Status (Heap): <br> Total Address Space: 12648448<br> Total Uncommitted: 1802240<br> Total Committed: 10846208<br> Total Allocated: 9250932<br> Total Free: 779084<br> Free Small: 487808<br> Free Big: 291276<br> Unused: 0<br> Overhead: 816192<br> Heap Error Code: 0<br>End of SiteCheck<BR>
|
|
|
|
|
Ummm did you have like a question or something? wait.... never mind
|
|
|
|
|
For that task, the string methods are also good enough!
string AllText="TCatalog: OK<BR>DATSVR: OK<BR>";
string searchstring ="TCatalog:";
string result="";
int startindex = AllText.IndexOf(searchstring);
if(startindex>=0)
{
int endindex = AllText.IndexOf("<", startindex);
if(endindex>=0)
{
result= AllText.Substring(startindex+ searchstring.Length, endindex- searchstring.Length).Trim();
}
}
All the best,
Martin
|
|
|
|
|
I am not sure I follow if the text that I am looking for after TCatalog and DATSVR could be either OK or Off-Line. I am going to pull data from about 40 different pages every 15 minutes or so to get new values. As you can see some of the feilds are dollar values so I will need to replace the old value in the dataGrid and also I will be adding a total value in a label.
Thanks the quick replies.
|
|
|
|
|
Use the Expresso tool found on this site to help with regular expressions
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi
I have an application which runs a login screen before the main program runs.
The login only succees when the user enters the right credentials.
The login screen is loaded to show as a dialog. When it closes the main class is run which is tha actual application. I need to access a property which I created in the Login screen's class, in the form_load event of the main class.
However I cannot access the variable which is declared in the Program.cs which is used to load the login screen. It keeps telling me : "The name 'frmTheLogin' does not exist in the current context"
Here the Program.cs code :
namespace ChequeApp
{
static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
frmLogin frmTheLogin;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
frmTheLogin = new frmLogin();
if (frmTheLogin.ShowDialog() == DialogResult.OK)
{
Application.Run(new frmChequeApp());
}
}
}
}
Here the Login class code :
namespace ChequeApp
{
public partial class frmLogin : Form
{
private string strUsername; //private variable for username.
IntPtr iptrTheToken;
private Int32 intAccessRight;
//Read-only property for username.
public string Username
{
get
{
return strUsername;
}
}
//Read-only property for the access rights.
public Int32 AccessRight
{
get
{
return intAccessRight;
}
}
...
}
Here the main class code :
namespace ChequeApp
{
public partial class frmChequeApp : Form
{
private string strUsername;
private Int32 intAccessRight;
private System.Windows.Forms.UserControl ctrlChequeApp;
public frmChequeApp()
{
InitializeComponent();
}
private void DisposeControl()
{
if (ctrlChequeApp != null)
{
this.Controls.Remove(ctrlChequeApp);
ctrlChequeApp.Dispose();
ctrlChequeApp = null;
}
}
private void ShowControl()
{
ctrlChequeApp.Location = new Point(1, 1);
this.Controls.Add(ctrlChequeApp);
ctrlChequeApp.BringToFront();
ctrlChequeApp.Dock = DockStyle.Fill;
}
private void frmChequeApp_Load(object sender, EventArgs e)
{
strUsername = frmTheLogin.Username; //IT ERRORS HERE
intAccessRight = frmTheLogin.AccessRight; //IT ERRORS HERE
}
...
}
|
|
|
|
|
Oederu wrote: It keeps telling me : "The name 'frmTheLogin' does not exist in the current context"
You don't understand "scope" and yet your are writing an application which requires logging in.
|
|
|
|
|
frmChecqueApp has no knowledge of frmTheLogin since they are in separate scopes.
You need to make frmChecqueApp aware of the form (and preferably only the data from the form that you want access to).
My suggestion would be to pass in the username and accessright into frmChecqueApp's constructor as follows:
public frmChequeApp(string userName, Int32 accessRight)
{
InitializeComponent();
strUsername = userName;
intAccessRight = accessRight;
}
and then in your Program.cs you would change it to:
namespace ChequeApp
{
static class Program
{
[STAThread]
static void Main()
{
frmLogin frmTheLogin;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
frmTheLogin = new frmLogin();
if (frmTheLogin.ShowDialog() == DialogResult.OK)
{
Application.Run(new frmChequeApp(frmTheLogin.UserName, frmTheLogin.AccessRight));
}
}
}
|
|
|
|
|
Thank You that helped a lot. I thought that all components/variables in the
base class could see each other but that is not so. Now I know. Thanks again.
|
|
|
|
|
Hello,
I am trying to fill a datagridview with a very large file (about 600 000 rows), i keep getting a ("Exception of type 'System.OutOfMemoryException' was thrown.")Error, but I do not see how I could be out of memory. Is there a max amount of rows that a data grid view can hold?
Hope some one can help
J
|
|
|
|
|
jasper018 wrote: but I do not see how I could be out of memory
Just a wild guess but maybe memory is not an infinite resource
Use "virtual mode" see the documentation for details
|
|
|
|
|
Hi,
I am facing a problem while using pepared statement for inserting data in MS-Access db.
<code>private const String CONN_STR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Temp\\TestDb.mdb";
conDatabase.Open(CONN_STR, "", "", -1);
String sQuery = "INSERT INTO " + sTableName +
" ([FileName],[IsCopied],[Size]) VALUES (@FileName,@IsCopied,@Size)";
cmdPrepStmnt.ActiveConnection = conDatabase;
cmdPrepStmnt.CommandText = sQuery;
cmdPrepStmnt.CommandType = CommandTypeEnum.adCmdText;
cmdPrepStmnt.Prepared = true;
int iCount = 0;
foreach (FileInfo f in fInfo)
{
Console.WriteLine("Adding File " + ++iCount + " of " + fInfo.Length + "; " + f.Name);
Parameter p1 = cmdPrepStmnt.CreateParameter("@FileName", ADODB.DataTypeEnum.adVarWChar, ParameterDirectionEnum.adParamInput, 255, f.FullName);
Parameter p3 = cmdPrepStmnt.CreateParameter("@IsCopied", ADODB.DataTypeEnum.adBoolean, ParameterDirectionEnum.adParamInput, 10, false);
Parameter p5 = cmdPrepStmnt.CreateParameter("@Size", ADODB.DataTypeEnum.adInteger, ParameterDirectionEnum.adParamInput, 10, f.Length);
cmdPrepStmnt.Parameters.Append(p1);
cmdPrepStmnt.Parameters.Append(p3);
cmdPrepStmnt.Parameters.Append(p5);
cmdPrepStmnt.Execute(out objAffected, ref obj, 0);
}
</code>
FileName is coming as blank in db, while in debug mode i can see that it is being set with a proper filename. The other 2 params are inserting fine.
The FileName field is set as Text field with width length 255, and the incoming data is always shorter than 255 chars. The insertion happens without any errors/exceptions. I have also tried replacing the data for filename with a string like "Test", still it is inserting blank string.
Please help.<code></code>
|
|
|
|
|
Access uses the ? placeholder for parameters, not SQL Server type parameters. It is positional based, so you should use something like
String sQuery = "INSERT INTO " + sTableName +
" ([FileName],[IsCopied],[Size]) VALUES (?,?,?)";
Then, add your parameters using CreateParameter("?", ....); in the order they appear in the list, i.e. FileName then IsCopied an finally Size.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I found recently that named parameters do work with Access/Jet, and they can even be used more than once, but they still need to be in order.
I didn't respond to the post earlier because the code doesn't look like OleDb / ADO.net
|
|
|
|
|
this is slightly stupid but how do i pass command line arguments with Visual Studio???
|
|
|
|
|
Select Project->Properties menu item, then (in the newly appeared window) select the Configuration properties->Debug node and finally set the command line arguments line content to whatever you need.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
I'm wondering if there's any way to disable "Close" button on window's title bar?
Thanks in advance.
Goran
|
|
|
|
|
Have you looked at the properties on the form?
|
|
|
|
|
Actually, I forgot to tell that I need this in TreeView derived control, not on Form derived control.
So, the question is how to disable "Close" button in .NET's class which is derived from Control class, in my case TreeView control?
I'm sorry I've missed full information.
-- modified at 11:11 Monday 30th July, 2007
|
|
|
|
|
To display the treeview you still have to put it on a form?
|
|
|
|