|
Hi
I want to populate a combobox with the name of the tables of one access database. I use the following statment
I get stuck on the error Record(s) cannot be read; no read permission on 'MSysObjects'.
Any help?
My code:
<
Database db;
OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\DB1.mdb");
OleDbDataAdapter adt;
DataSet ds;
cn.Open();
adt = new OleDbDataAdapter("select name from msysobjects where type=1 and flags=0", cn);
ds = new DataSet();
adt.Fill(ds);
comboBox1.DataSource = ds;
>
|
|
|
|
|
KIDYA wrote: ("select name from msysobjects where type=1 and flags=0", cn);
I might be wrong but I would say rewrite the above as follows:
(Select Name1 FROM msysobjects WHERE type = '"1"' AND flags = '"0"', cn);
SQL is case sensitive and the values must be wrapped in '" "'.
Give this a try and see. I would also change the Column Name to Name1.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
When first released, ASP.NET lacked a template engine.
So now, for .NET 2.0, ARE "master pages", ASP.NET'S version of a template Engine?
If no, how do regular Template engines (StringTemplate) differ from 'Master Pages'?
Thanks in advance,
Laura
|
|
|
|
|
This is not the best place to ask ASP.NET Questions. There is a seperate forum for it.
Either you love IT or leave IT...
|
|
|
|
|
I cannot get generics to return a type that it does not know is correct.
I have a collection of general objects each with a sorted keyfield ID
cTypeA 2
cTypeB 3
cTypeA 7
cTypeA 9
cTypeB 12
in one ArrayList, all of which derive from cType.
I want to create a separate list of ID references using generics, but which returns the actual objects in an indexer. That way I am assured of type safety when using the object (displaying in a listview say) rather than casting at the end use point:
public class cList<T>
{
public cList(cIDList UseOwner)
{
Owner = UseOwner;
ListItems = new ArrayList();
}
public T this[int Index]
{
get
{
if ((Index >= 0) && (Index < ListItems.Count))
{ return (T) Owner.GetObject((int)ListItems[Index]);
}
}
}
private cIDList Owner;
private ArrayList ListItems;
}
to implement this
cList<cTypeA> AItem = new cList<cTypeA>(MyIDList);
(assume items added)
cTypeA UseA = AItem[2];
Is there a way to solve this problem? The only way I can see is to do the above without generics, copy and paste then change the return cast type for what I use now, and in the future. Not easily manageable!
Thanks.
|
|
|
|
|
You can use a generic List instead of an untyped ArrayList , then copy the required references in the c'tor. (This assumes you are using .NET 3.5 - and of course your cIDList must be an IEnumerable , i.e. derived from any of the usual .NET collection classes).
Here's what it will look like:
public class cList<T>
{
private readonly List<T> ListItems = new List<T>();
public cList(cIDList UseOwner)
{
if (UseOwner != null)
{
ListItems.AddRange(UseOwner.OfType<T>());
}
}
public T this[int Index]
{
get
{
if ((Index >= 0) && (Index < ListItems.Count))
{
return ListItems[Index];
}
return null;
}
}
}
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
modified on Sunday, May 3, 2009 11:35 AM
|
|
|
|
|
You probably need to redesign whatever it is you're trying to do.
Otherwise, try cTypeA UseA = AItem[2] as cTypeA ;
|
|
|
|
|
from where i can download sql database template for visual studio
can any buddy provide link plz
|
|
|
|
|
What (kind of) template are you looking for?
I'm having trouble understanding what it is that you seek, please rephrase the question.
I are troll
|
|
|
|
|
if you go to your solution explorer there is an option "Add new item". then there will be a "Sql DataBase" template. i dont have that n i want that.
thanks
|
|
|
|
|
I guess that the template is installed by SQL Server (Express?). Try downloading/installing that, or repairing the Visual Studio installation itself.
I are troll
|
|
|
|
|
It would appear that you have to Express edition of Visual Studio, which does not come with Database project templates. There is no legal place to download those templates.
|
|
|
|
|
I want to control some hardware by internet. In order to do that I want to use ASP.NET and C# language. Suppose I want to turn on a LED which is placed in a PCB board. That PCB board is connected to a computer which has internet connection. From remote distance I will do some thing so that that LED will be turned on. If any body know some things abut the above meter please inform me as soon as possible.
Rashed
|
|
|
|
|
Are you hoping to become a developer or just spamming the site with a stupid question?
If you are then I suggest you start with something simpler, maybe "hello world" would be a good start. Read, study, try some things and ask specific questions about problems you encounter.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
rashed.info wrote: In order to do that I want to use ASP.NET and C# language.
That means that the computer who has the PCB-card in it needs to be an ASP.NET server
I suggest you browse the Coding 4 Fun[^] blog, it has some hardware-related projects that could get you started.
I are troll
|
|
|
|
|
Hi All
I Install my Windows Project In PC .
In The First Run Of the Application Is Run As Correct Way.
but the secound Run Of the Application The Windows Give Me the Error In Message Box
The Message IS :
Unable to find a version of the runtime to run this application .
and the Caption of a message is
Management.exe .Net FramWork Initailization Error
What Is this Error ??
How I Can Solve It ??
Thanks All
Thaer
modified on Sunday, May 3, 2009 2:46 AM
|
|
|
|
|
|
Usage of this thing
But not that good help
I have all the solutions proposed, but did not change something
We put that question to answer me one of them has been successful with the process and not to provide a teacher how to search
Thanks Mr
Thaer
|
|
|
|
|
HI
when i want to input my equation (ex: ((Math.Pow(x,5)) + x - 1) ) from textbox to function this erro
appear . format exeption was unhandeld .
my code is here
public double func(double x)
{
return (double.Parse((txtEq.Text)));
}
i want to user can input equation from textbox.
Thank u so much
|
|
|
|
|
Just typing in an equation and expecting the Double parser to understand and evaluate it, isn't going to work. You have to write your own equation parser and evaluate it yourself. There is nothing in the .NET Framework that will do this for you. Google for "Reverse Polish Notation" for information on one algorithm that can help you do this.
|
|
|
|
|
|
Hey all,
I was wondering if anybody else is experiencing problems trying to view any Microsoft websites such as MSDN.com, Hotmail.com, Microsoft.com or any other Microsoft website? For a week now I have been trying to get on to the MSDN website to check out some things but it never loads, my system has been scanned several times with a few different programs, and I know it isn't my firewall or my Internet because every other website works perfectly... Is Microsoft experiencing any problems? Thanks all
jay
foreach( inch on Jason )
{
Girlfriend.IsHappier();
}
|
|
|
|
|
They all work fine for me. Try clearing the browser cache.
|
|
|
|
|
jas0n23 wrote: Is Microsoft experiencing any problems?
Probably, but as for the MSDN website - it works fine.
|
|
|
|
|
Hi,
I would like to develop a VS 2005 Add-in that provides a new document editor for a custom file type of mine. Could someone point me at some documentation or a tutorial that would help me to achieve this because I am currently having difficulty finding any.
Thanks,
Steve
|
|
|
|