|
I just checked it, "Parent" is definitely a keyword, but i cannot rename the column (I dont' have sufficient privilages to the database), how can I tackle the problem?
- A programmer's national anthem; "AAAAAHHHHH!!!!"
|
|
|
|
|
Try putting Parent inside square brackets: [Parent]
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Thanks for help....
- A programmer's national anthem; "AAAAAHHHHH!!!!"
|
|
|
|
|
sorry the line DataRow e_Rows = grammerTable.Select(strFilter) is actually DataRow[] e_Rows = grammerTable.Select(strFilter) . I forgot to put the square brackets before...
- A programmer's national anthem; "AAAAAHHHHH!!!!"
|
|
|
|
|
i have a usercontrol which has a datagrid . i have given textbox column styles for each column
this is the textbox column style that i'm using in the datagrid
//Name
nameColumnStyle.MappingName = "Name";
nameColumnStyle.HeaderText = "Name";
nameColumnStyle.Width = 100;
nameColumnStyle.TextBox.TabIndex = 2;
i have four columns...each of textbox column style. i have also given tabindexes for each column.
my problem is at runtime, when i press Tab key in the datagrid, it moves two places .Like if control is on first column, then if i press Tab key to go to the second column, it moves to the third column.
Also if there are buttons, it runns two places ahead...
can any one tell me why this happens, and how to get rid of it..
any help will be appreciated...
no one replied to my problem...so m sending it again.. ..
|
|
|
|
|
deep7 wrote:
nameColumnStyle.TextBox.TabIndex = 2;
I assume these are numbered 1 - 4 from left to right ? If so, then I can't imagine what the problem is. Is this a web or winForms project ? If you can give me a better outline, I'll whip up a project to see if I can duplicate the behaviour.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
its window application...and even if i dont give the tabindex, it still skips one column and goes to the third
below is how i add the column styles to the grid:
private void AddGridColumnStyles()
{
DataSet dataSetObj = new DataSet("Airlines ");
dataTable = new DataTable ("Airlines ");
dataTable.Columns.Add("ID",typeof(int));
dataTable.Columns.Add("Code",typeof(string));
dataTable.Columns.Add("Date From",typeof(DateTime));
dataTable.Columns.Add("Date To",typeof(DateTime));
dataTable.Columns.Add("Description",typeof(string));
dataSetObj.Tables.Add(dataTable);
dataGridSeasons.SetDataBinding(dataSetObj,"Airlines ");
tableStlye.MappingName = "Airlines ";
//hidden ID
seasonIdColumnStyle.MappingName = "Season ID";
seasonIdColumnStyle.HeaderText = "Season ID";
seasonIdColumnStyle.Width = 0;
// Code
seasonCodeColumnStyle.MappingName = "Code";
seasonCodeColumnStyle.HeaderText = "Code";
seasonCodeColumnStyle.Width = 100;
seasonCodeColumnStyle.TextBox.TabIndex = 2;
//Date From
seasonStartDateColumnStyle.MappingName = "Date From";
seasonStartDateColumnStyle.HeaderText= "Date From";
seasonStartDateColumnStyle.Width = 100;
seasonStartDateColumnStyle.MyDateTimePicker.TabIndex = 3;
//Date To
seasonToDateColumnStyle.MappingName = "Date To";
seasonToDateColumnStyle.HeaderText= "Date To";
seasonToDateColumnStyle.Width = 100;
seasonToDateColumnStyle.MyDateTimePicker.TabIndex = 4;
//Description
descriptionColumnStyle.MappingName = "Description";
descriptionColumnStyle.HeaderText = "Description";
descriptionColumnStyle.Width = 100;
descriptionColumnStyle.TextBox.TabIndex = 5;
tableStlye.GridColumnStyles.Clear();
tableStlye.GridColumnStyles.Add(seasonIdColumnStyle);
tableStlye.GridColumnStyles.Add(seasonCodeColumnStyle);
tableStlye.GridColumnStyles.Add(seasonStartDateColumnStyle);
tableStlye.GridColumnStyles.Add(seasonToDateColumnStyle);
tableStlye.GridColumnStyles.Add(descriptionColumnStyle);
dataGridSeasons.TableStyles.Clear();
dataGridSeasons.TableStyles.Add(tableStlye);
}
could u tell wots going wrong?? code works fine...but only when i press Tab key, it skips one column and goes to the next...Also the button for 'Save' and 'close'.Their Tab Indexes are 6 and 7.So after the datagrid, the control has to go to 'Save', but it runs to 'Close' button.Don't know why it happens
any help is appreciated
thanx,
Dee
|
|
|
|
|
hey Christian,did u get wot is wrong? n why it behaves like tat?
|
|
|
|
|
Hi!
Great people,
I m developing a application in c#, which will run on my home pc and Tablet
Pc also.
I m new for Tablet pc appln . So i need some help, I have to create some form
which have question and answer, Now my problem is this how a form will set
for both purposes ( HomePc and Tablet) . I mean the hight and width of form
have to be set according to the machine, and what type of other control i
have o use for TabletPc so that it can use the INK PEN for replying the
answer of the questions.
I m waiting for positive reply from great people side.
Thanx.
keep smilling.....b'coz smile is the shortest distance between people....
|
|
|
|
|
|
i am trying to design a translator which converts c code into vb script using c# as tool.i am not much experienced in this kind of work.can anyone plese help me?
With Love Sai
|
|
|
|
|
hi i am new to cpp using include
#include <stdio.h>
#include <stdlib.h>
i used iostream before though now i am trying to make a simple code for input and comparing the input could anyone help me? i just need some simple beginning code thx u
|
|
|
|
|
|
what are the advantages that we have in managed code over unmanaged code? This security stuff is justa out of my mind. Any help please.
If I am writing a sofwrae, say a windows application , is it necessary to have take all security mmeasures? I think security is something associated with internet. I am such a naive. I am a 5 year kid may be.
Amit
|
|
|
|
|
With unmanaged code you get:
:: Optimized compiling. The final code is optimized for the exact processor it will be run on.
:: System independance. You can run your progam in any system that supports the framework. Currently there is an implementation in Linux. I would expect more to come.
:: Security. The program can be sandboxed, totaly isolating it from any resources it doesn't need.
Regarding security, just make sure that the program never destroys the data it's using, and always cleans up any unmanaged resources. After that it's more a question of quality. A good program doesn't crash just because you entered some text in a field that should be numeric.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa.
Which are the operating systems that support the .net framework? Like if I creat a .exe in C# will it run on win98 and older version. Do those operating systems support the framework? And, can we develop applications for Linux Using C#?
Amit
|
|
|
|
|
"Supported Operating Systems: Windows 2000; Windows 98; Windows ME; Windows NT; Windows XP"
Microsoft .NET Framework 1.1[^]
Mono is available for Linux/x86, Linux/x86_64, Linux/S390, Windows 2000+ and Mac OS X.
Mono[^]
---
b { font-weight: normal; }
|
|
|
|
|
can anyone help to point the issue? I have struggled this for a day and cannot get any where.
I want to create a COM+ object remotely. The code is really simple as below.
I also did "gacutil -i "and "regsvcs" for both interface dll and COM+ object. also double check the existance in GAC and regedit.
When executing the test client at the line, NewPDFNoQueNew myPDF = new NewPDFNoQueNew();,i did see a DLLHOST.exe kicked off, then at this time, i am able to attach DLLHOST.exe from the Visual Studio COM+.
But some how, it throws "unable to cast object of type PDFNoQueNew.PDFConvNoQueNew to NewPDFNoQueNew".
Thank you so much in advance.
1 Interface DLL.
using System;
using System.Diagnostics;
using System.EnterpriseServices;
using System.Runtime.InteropServices;
using System.Reflection;
namespace IPDFPrintTestNew
{
[Guid("050355EC-83C9-4723-9E2D-AAAAD3CA3BAF")]
public interface IPDFPrint
{
string PDFPrintMethod();
}
}
2. COM+ object //add a reference to IPDFPrintTestNew
using System;
using System.Runtime.InteropServices;
using System.EnterpriseServices;
[assembly: ApplicationName("PDFNoQueNewApp")]
[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ApplicationAccessControl(Value = false,
Authentication = AuthenticationOption.None)]
namespace PDFNoQueNew
{
[Guid("050355EC-83C9-4723-9E2D-AAAAD3CA3FFF")]
public class PDFConvNoQueNew: ServicedComponent, IPDFPrintTestNew.IPDFPrint
{
public string PDFPrintMethod()
{
return ("ok");
}
}
}
3. Client test //add a reference to IPDFPrintTestNew
using System;
using System.Runtime.InteropServices;
using System.EnterpriseServices;
namespace PDFNoQueNewClientTest
{
class Class1
{
[ComImport, Guid("050355EC-83C9-4723-9E2D-AAAAD3CA3FFF")]
class NewPDFNoQueNew
{
}
[STAThread]
static void Main(string[] args)
{
NewPDFNoQueNew myPDF = new NewPDFNoQueNew();
IPDFPrintTestNew.IPDFPrint iPDF = (IPDFPrintTestNew.IPDFPrint)myPDF;
string result = iPDF.PDFPrintMethod();
return;
}
}
}
|
|
|
|
|
hi
just a simply performance question.
when my_object is null what is the best code between ?
<br />
try<br />
{<br />
my_object.myfunct();<br />
}<br />
catch(Exception)<br />
{...}<br />
and
<br />
try<br />
{<br />
if(my_object==null)<br />
throw(new Exception("Object is null"))<br />
my_object.myfunct();<br />
}<br />
catch(Exception)<br />
{...}<br />
|
|
|
|
|
This is a good little article that will enlighten you on the subject: Performance Implications of Exceptions in .NET[^]
By the way, you should probably try to catch a specific exception (NullReferenceException ) instead of the catch-all Exception .
Matt Gerrans
|
|
|
|
|
Avoid the exception alltogether. If you check for the null value, you don't need to throw an exception, as you have control over the situation. Exceptions should only be used to handle situations that you can't control in any other way.
---
b { font-weight: normal; }
|
|
|
|
|
Say I want to draw the following numbers at equal intervals inside of
a Rectangle drawn on a WinForm (call it graphRect).
For instance:
1.0 2.0 3.0
I've been using:
float myfloat = 1.0f;
string myString = myfloat.ToString();
for( int x <= graphRect.Width....
{
DrawString(myFloatString.ToString("f1"), graphRect.X + ....
}
Is there a better way?
How best to increment the float through each iteration?
thanks
|
|
|
|
|
hi, is it possible to use a XML Dokument as a Database? because i dont want to install a SQL Server!
how can i establish a Odbc or Oledb Connection to the XML Database? than i want to fill the DataSet and display it in a DataGrid!
thx in advance! bye
|
|
|
|
|
You can create your schema definition using Visual Studio's schema editor. It is very similar to "Enterprise Manager". Just keep in mind the following: "Create Element" to create a table. Add "Attributes" instead of elements to specify the columns (it makes it much more readable). You can apply same rules as Enterprise Manager such as Cascaded Foreign Keys, auto-increments, etc. In your code use DataSet to load your schema. Your Dataset has access to all tables and your tables have access to all rows and columns. Each DataTable can have more than one DataView that filters the data from same table based on different criteria. Use DataTable.Select to select specific rows based on criteria....etc, etc. Hope this is of some help.
|
|
|
|
|
If I have the following in my class
private static object padlock = new object();
Then somewhere in my class I happen to call this more than once
lock( padlock )
{
}
If I call lock on padlock more than once what is happening behind the scenes?
1) Are the number of references to padlock incremented?
2) Or is the Exit method just called once for each lock()
Thanks
|
|
|
|