|
Hello everyone,
I've got a little problem.
I made a project and it runs well. In the project I access a database, I create table and access them. The database I use is Microsoft SQL Server 2005, the free database from Microsoft. After I installed it, I enter a connectionstring like this: DERESEN\SQLEXPRESS and it will work fine. So I tried it with my friends computer and it didn't work, I had to change the name (DERESEN) in the computer's name, so I did it like this: Environment.MachineName + "\SQLEXPRESS". And it did work.
Now the problem: I need to get it work on every (Windows-based) computer, so I let my girlfriend instal it at her computer (a computer no-no should be able to do it), but it didn't work. I let her instal SQL Server 2005 and it didn't work.
So now my question:
Is there any database which is ALWAYS installed on a windows computer which I can access. Or is there another way (which I didn't see) to get a database running?
I hope you can help me, because I've been searching for days for an answer to this problem.
|
|
|
|
|
Deresen wrote: Is there any database which is ALWAYS installed on a windows computer which I can access.
No.
Deresen wrote: Or is there another way (which I didn't see) to get a database running?
You could always use SQL Server Compact Edition[^]. This runs inside the process space of the application (it runs as a DLL) and it's free.
|
|
|
|
|
Use .\SQLEXPRESS or (local)\SQLEXPRESS
More about connection strings[^]
And make sure that the database is attached to the server.
Sql server (not windows) has its system databases that you should not manipulate.
Eslam Afifi
modified on Thursday, September 11, 2008 8:17 PM
|
|
|
|
|
Eslam is correct, but SQL Server has to be installed with the "default instance" to be able to do that. If someone installs it using a "named instance" and calls it something else, it won't work.
|
|
|
|
|
Deresen wrote: Is there any database which is ALWAYS installed on a windows computer which I can access
No.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
You can use SQLite[^] for your purposes. It's just a single file database. There is also ado.net managed provider for it: System.Data.SQLite[^]
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
This is probably a simple question, but how do I open another application from a Windows form?
What I basically want to do is execute a search for a file or files, have those files appear in a listbox, then have the application open the selected file using a specific application installed on the user's desktop. It's basically a simplified Windows search application designed for a very specific purpose.
Thanks.
|
|
|
|
|
Use System.Diagnostics.Process.Start to start the application. If the file is associated with a default application, that application will be started up - so, for instance, executing Process.Start(@"c:\MyFile.doc"); would start Word and load that document.
|
|
|
|
|
System.Diagnostics.Process.Start
Eslam Afifi
|
|
|
|
|
I have 6 tabs on my windows forms. I want it to change tabs with I click the next button can you any help.
Shelby Learning the Code!
|
|
|
|
|
Call SelectedTab and select the tab you want.
|
|
|
|
|
private void Navigate()
{
//this.tabControl1.SelectedTab = this.tabPage1;
//this.tabControl1.SelectedTab = this.tabPage2;
//this.tabControl1.SelectedTab = this.tabPage3;
//this.tabControl1.SelectedTab = this.tabPage4;
//this.tabControl1.SelectedTab = this.tabPage5;
}
This is what I have. I need with I click the Next button it on to tab 2 if I press again tab 3 and so on. I click the previous button it goes backward.
Shelby Learning the Code!
|
|
|
|
|
So keep track of which tab you're on and use that as the basis for navigation.
|
|
|
|
|
Need help in writing this.
Shelby Learning the Code!
|
|
|
|
|
Name 2 buttons "btnPrev" and "btnNext". Name a tab control "tabControl1". Create "Click" event handlers for the two buttons and put the code in them like this:
private void btnPrev_Click(object sender, EventArgs e)
{
if (tabControl1.SelectedIndex > 0)
tabControl1.SelectedIndex--;
}
private void btnNext_Click(object sender, EventArgs e)
{
if (tabControl1.SelectedIndex < (tabControl1.TabCount - 1))
tabControl1.SelectedIndex++;
}
|
|
|
|
|
Hi,
I found several answer about typedef with "using" but it doensn't fit to my problem...
I'd like to do something like this in C#
typedef float Real;
because, someday I may need to create my own class Real and then I wouldn't need to replace every word (I know I could use the visual studio editor "Replace All" option, but I think it's too dangerous if I'm in the middle of a project that could have up to 1000s of files.
Thanks,
Dirso
|
|
|
|
|
However, you could create a wrapper class at the expense of speed. It really is unfortunate that you cannot inherit base types in .NET.
Another option which is more sloppily elegant ... Create a new class whose only method is a static, implicit operator that converts between itself and the type you want.
Then declare your code using floats in the following manner:
float myFloat = ((MyClass)5f);
When it comes time to change the value of the float change the implicit operator's type and you will get compile time errors showing you every location that needs to be changed.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
What have you tried so far? In what way does it not fit?
|
|
|
|
|
C# has a very natural equivalent for this:
The C# equivalent of:
typedef float Real;
is simply:
using Real = System.Single;
Note that you can't use the C# aliased name on the right side, it must be the 'proper' type name.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
My problem about that is that I'd like to define it once, not in every single file.
Thanks anyway for trying,
Dirso
|
|
|
|
|
Oh, then pass your code through the C-preprocessor, it's good at hiding details like that.
|
|
|
|
|
I have a reference to a web service, which has its URL "hard-coded" (not really, because it is part of the settings).
Here, we must fetch application settings elsewhere (it is the SSO configuration store).
I could do the following:
MyWebService s = new MyWebService();
s.Url = "some url";
s.MyMethod();
But I would prefer the following:
MyWebService s = new MyWebService("some url");
s.MyMethod();
I noticed that the C# code generated declares the MyWebService class as partial. Is there a way I could provide a partial implementation of that class, where there would be a constructor taking a URL as its parameter?
I tried, but it did not work. I remember that you could do it with editor-generated typed datasets.
|
|
|
|
|
I would guess you can create a partial class with a constructor that takes the URL. You said this didn't work - what happened exactly?
|
|
|
|
|
Hey all,
I was wondering if there is a way to make specific rows in the checkedlistbox disabled (no able to toggle the check mark). I want to be able to list some options which are mandatory and have others optional.
If there is a better control for this, I'd happily switch ;D
Thanks!
Mike
FREE 28 player online game @ http://www.1483online.com where the community drives enhancements to the game!
|
|
|
|
|
CheckBoxList1.Items[0].Enabled = false;
Where 0 is the index of the item to disable. You could do this in a loop or bind a bool value from your datasource depending on how you're populating it (the CheckBoxList).
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|