|
Maybe this is a dumb question. If I have MS SQL Server Desktop Edition, can I access the database from a seperate computer? Or do I need SQL Server for that? 'Cause I sure can't afford to get SQL Server, and my database application is only going to be deployed on 3-5 computers.
Thanks for the help.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
theStorminMormon wrote:
Maybe this is a dumb question. If I have MS SQL Server Desktop Edition, can I access the database from a seperate computer? Or do I need SQL Server for that? 'Cause I sure can't afford to get SQL Server, and my database application is only going to be deployed on 3-5 computers.
You can use MSDE 2000 from other computers on the network. I do this all the time.
Providing the correct permissions are set then you should have no problems.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
OK - so just to be absolutely clear, if I run MSDE 2000 on a "server" (it's actually just my desktop running win xp pro) and I deploy an application to my client (my laptop) that accesses a database on my server via MSDE 2000 - that should work? Right now my application runs fine on the server, but it can't find the database from the client. This is connection string:
private string strConn = @"Integrated Security=SSPI; Packet Size=4096 ;Data Source=""EC-BJACOBS""; Initial Catalog=BenefitSelectDBSQL; Provider=""SQLOLEDB""; Workstation ID=""EC-BJACOBS""; Use Encryption for Data=False";
Next question - how do I set the correct permissions?
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
theStorminMormon wrote:
private string strConn = @"Integrated Security=SSPI; Packet Size=4096 ;Data Source=""EC-BJACOBS""; Initial Catalog=BenefitSelectDBSQL; Provider=""SQLOLEDB""; Workstation ID=""EC-BJACOBS""; Use Encryption for Data=False";
Next question - how do I set the correct permissions?
You are currently using Windows Authentication? Do you have a domain controller that manages your user security? If so, just add the domain users as users in your database and give them the required permissions.
If you don't have a domain controller, then it becomes a bit of a pain to use Windows Authentication. It is easier to create SQL users and change the connection string to use SQL authentication.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
When I originally installed and set up MSDE 2000 and my database, I had no clue what I was doing. The directions were unclear (to me) and I considered myself extraordinarily lucky when my program actually connected to the database at all (I still don't understand the connection between the database that I designed in Access, MSDE 2000, the SQL Server, and my C# application). What I'm trying to convey with all of this is that it's purely accidental that I ended up using Windows Authentication, and I would prefer to create SQL users and change the connection string to use SQL authentication if only I knew how.
Can you give some pointers on how to do this? The only access I have to MSDE 2000 on my own machine is too click on the little icon in the system tray - which brings up the SQL Service Manager (which doesn't let me do anything useful).
I just downloaded DbaMgr2k to try and get better access to the server (to add users, change authentication type) but I'm not sure how this works.
Any help you could offer would be great. I have books on C#, ADO.NET, and MS Access, but running MSDE 2000 seems to fall between the cracks and each book only offers tidbits on how to use it.
Thanks.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Hehe, that's about the way I felt when installing MSDE for the first time.
Having access to the EnterpriseManager of a "full" SQLServer helps alot, though.
MSDE basically is a full SQLServer with only performance-related restrictions, so you can use all the built-in stored procedures, for example, to manage database access, users and so on.
Try opening a command shell and type "osql -E" to open up an SQL-"shell" you can use to query your databases.
Some time ago I found the online documentation for SQLServer2000 on microsoft.com. Pretty complete, helped me a lot. For example, it lists the stored procedures available and how to execute them.
You can download it here[^]
Regards,
mav
|
|
|
|
|
Thanks, I'm downloading it now. Hopefully it will help.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
hi
Just wondered if any knew of a simple way to control the PC's volume
within c# ?
Cheers
Richard
|
|
|
|
|
Hi,
I have to update a program while it is working. First i stop the process of programme then i copy new files and restart the process of program.At this time i see 2 system tray icon of my programme. When i move mouse over them the killed process's icon removes itself. But i want it to be destroyed when i first kill it's process.Could someone help me plz?
--junior coder--
|
|
|
|
|
Hi,
I have a little problem: I'm trying to open notepad.exe from my windows application and I'm using a Process and WaitForExit on it. Notepad stats correctly but when I try to move its windows I see the movement on the caller application. Does anyone know why and how can I fix it?
Here there's the code:
Process newProcess = new Process();
newProcess.StartInfo.FileName = filename;
newProcess.Start();
newProcess.WaitForExit();
thanks!
Loveday
-- modified at 9:05 Thursday 1st September, 2005
|
|
|
|
|
Loveday78 wrote:
see the movement on the caller application
Could you explain it a bit more?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Sorry, i'll try:
when i move notepad's window i see as if there were many windows; a sort of tail stating from the original location and ending in the new location of the window. This only on the screen's region over the "parent" application (the one that started the process).
I have no problem if i don't use WaitForExit (but i need to).
Better?
-- modified at 2:44 Friday 2nd September, 2005
|
|
|
|
|
Use threading to start notepad on a new thread.
www.lovethosetrains.com
|
|
|
|
|
Hi!
I'm trying to copy data from Oracle to Access 2000. For this project, I'm not allowed to use ADO.NET 2.0 unfortunately (BulkCopy would really help me), so I'm trying to do it by myself. My idea is to create a DataSet with the data of Oracle, and to push it in my Access database. For this I use the "DataSet.Merge" method and then the "DataAdapter.Update" method to write down the data. I don't have any error coming out, but nothing is written in the Acces DB.
Has someone met the same problems??
Has someone a better solution??
Many thanks in advance.
I join a copy of my code too :
using System;
using System.Data;
using System.Data.Odbc;
namespace consoOracle
{
///
/// Test connexion à Oracle
///
class afficheData
{
private OdbcDataAdapter da;
private DataSet ds;
int scr_no = 905;
public afficheData()
{
lireDataDsOracle();
ecrireDataDsAccess();
}
public void lireDataDsOracle()
{
//1. connexion à Oracle
System.Data.Odbc.OdbcConnection connOra;
connOra = new System.Data.Odbc.OdbcConnection();
connOra.ConnectionString = "DSN=ORA;Uid=uid;Pwd=pwd;";
try
{
//2. préparer une requète
string rqt = "Select LOC_C_LIBELLE_LONG As LOC_C_NOMLOCAL, "
+ "LOC_C_LIBELLE_COURT As LOC_C_NOMLOCALABREGE "
+ "From GEVI_T_LOCAL "
+ "Where LOC_SCR_N_ID = "+scr_no;
OdbcCommand cmd = new OdbcCommand(rqt, connOra);
da = new OdbcDataAdapter();
da.SelectCommand = cmd;
//3. ouvrir la connexion
connOra.Open();
//4. remplir le DataSet
ds = new DataSet();
da.Fill(ds, "Locaux");
// Console.WriteLine(ds.GetXml());
Console.WriteLine("C'est lu");
}
finally
{
//6. fermer tout
connOra.Close();
}
} //lireDataDsOracle()
public void ecrireDataDsAccess()
{
//1. connexion à Access
System.Data.Odbc.OdbcConnection connAcc;
connAcc = new System.Data.Odbc.OdbcConnection();
connAcc.ConnectionString = "DSN=ACC";
try
{
//2. préparer une requète
string rqt = "Select LOC_C_NOMLOCAL, "
+"LOC_C_NOMLOCALABREGE "
+"From GIDE_T_LOCAUX";
OdbcCommand cmd = new OdbcCommand(rqt, connAcc);
OdbcDataAdapter daAcc;
DataSet dsAcc;
daAcc = new OdbcDataAdapter();
daAcc.SelectCommand = cmd;
//3. ouvrir la connexion
connAcc.Open();
//4. remplir le DataSet
dsAcc = new DataSet();
daAcc.Fill(dsAcc, "Locaux");
//5. Merge
dsAcc.Merge(ds);
dsAcc.AcceptChanges();
//6. Ecriture
rqt = "Insert Into GIDE_T_LOCAUX ("
+"LOC_C_NOMLOCAL, "
+"LOC_C_NOMLOCALABREGE) "
+"Values ('@nom', '@nomAbrege'"
+")";
cmd = new OdbcCommand(rqt, connAcc);
cmd.Parameters.Add("@nom", OdbcType.NVarChar, 22, "LOC_C_NOMLOCAL");
cmd.Parameters.Add("@nomAbrege", OdbcType.NVarChar, 22, "LOC_C_NOMLOCALABREGE");
daAcc.InsertCommand = cmd;
try
{
daAcc.Update(dsAcc,"Locaux");
Console.WriteLine("Insertion OK");
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
Console.WriteLine(dsAcc.GetXml());
Console.WriteLine("C'est fini");
}
finally
{
//6. fermer tout
connAcc.Close();
}
} //ecrireDataDsAccess()
[STAThread]
static void Main()
{
new afficheData();
} //Main
}
}
|
|
|
|
|
I have a simple combobox that is populated with an array of items. How can I bind alternative data to each item? I am not trying to bring in a datagrid or anything. It isn't that complex. I simply want to choose an "item" within the combobox and when it is chosen display ANOTHER value that is binded to it within a textbox or something. Thanks in Advance.
Dizzle
|
|
|
|
|
If you wan your combobox item have many data you can create custom class and add it to to combo box item collection
public class ComboItemEx
{
private int id;
private string name;
private string address;
public int ID
{
get
{
return id;
}
set
{
id=value;
}
}
public string Name
{
get
{
return name ;
}
set
{
name=value;
}
}
public string Address
{
return address;
}
set
{
address=value;
}
public override ToString()
{
return name;
}
}
and some where you can add it
CombobItemEx cbi=new CombobItemEx();
cbi.ID=44;
cbi.Name="my name";
cbi.Address="my address"
comboBox1.Items.Add(cbi)
MCAD
-- modified at 14:21 Thursday 1st September, 2005
|
|
|
|
|
Thanks for the response, however, it doesn't seem to be working properly. This is my code:
public class ComboItemEx
{
private int id;
private string name;
public int ID
{
get
{
return id;
}
set
{
id=value;
}
}
public string Name
{
get
{
return name ;
}
set
{
name=value;
}
}
}
private void Form1_Load(object sender, System.EventArgs e)
{
comboBox1.SelectedValue = PurchaseOrderStatus.Finalizing;
ComboItemEx cbi=new ComboItemEx();
cbi.ID=44;
cbi.Name="my name";
comboBox14.Items.Add(cbi);
}
This is what it displays in the combobox:
MH53MPreconditions.Form1+ComboItemEx
Isn't there an easier way to do this? Possibly through enumeration? Thanks again.
Dizzle
|
|
|
|
|
Hi!
The ComboBox just shows what an item's ToString() method returns, so just overwrite ToString() to return what you want, for example, the name.
Regards,
mav
|
|
|
|
|
Sorry for that i forget to mention that you must override
ToString() as above response told you
I modified the original post
MCAD
-- modified at 14:24 Thursday 1st September, 2005
|
|
|
|
|
Hi,
I am drawing a line and I would like to draw an arc on the line based on the input angle given. The start point and the end point of the arc should be between the lines. The bubble should be bulgy as and when the degrees increases.
Advance Thanks to everyone.
|
|
|
|
|
Hello
After some methematics recall here is the code:
int length = int.Parse(lengthBox.Text);
float angleDeg = Math.Max(0.0f, Math.Min(90.0f, float.Parse(angleBox.Text)));
float angleRad = angleDeg * (float)(Math.PI / 180);
Graphics g = this.CreateGraphics();
Pen pen = new Pen(Color.Red, 1);
int x = 10;
int y = 150;
g.DrawLine(pen, x, y, x + length, y);
int r = (int) (((double) length / 2) / Math.Sin(angleRad));
int h = (int) (Math.Cos(angleRad) * r);
g.DrawArc(pen, x - (r - length / 2), y - (r - h), r * 2, r * 2, -90 + angleDeg, -2 * angleDeg);
pen.Dispose();
g.Dispose();
With best regards,
Andrew
|
|
|
|
|
Thanks Andrew. Excellent formula.
|
|
|
|
|
Thanx Andrew for the help u have provided.
|
|
|
|
|
how i use interbase database in .net window programing
i need tutoria l of this database..
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
|
|
|
|
|
Hi,
I have one dataset with two tables, in these tables parent table is related with child table by one column.
I have defined DataRelation object for binding data from these tables into datagrid.
When I bind a dataset with datagrid, the relations between tables are visible as links, on clicking link we can see child table's record. I don't want to display links of datarelations in datagrid.
AllowNavigation property of datagrid doen't work.
Can some one tell the solution?
Thanks
|
|
|
|