|
Write some thing like
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
startInfo.Arguments="/c help";
Process.Start(startInfo);
MCAD
|
|
|
|
|
Thank you.
But how do I have to arrange it to have the window kept open? (to see what happens)
Are there further beginning strings like "/C" for the argument?
Regards,
Axel
|
|
|
|
|
How can i get a client application to write an exception log file on a different computer (the server)?
r
John
|
|
|
|
|
By giving it a network path to write to, and the file/network permissions to allow that.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I hear a lot about "managed resources" versus "unmanaged resources"...for example, as it relates to implementing the disposal method pattern. What's the difference between the two?
|
|
|
|
|
A managed resource is something that the garbage collector can remove without affecting other systems. Like an array of strings.
An unmanaged resource is something that the garbage collector can not control. Like a database connection.
---
b { font-weight: normal; }
|
|
|
|
|
|
we are making client/server application, we have client machine, application server and database server,
first I want to know what are the pitfalls of making all clients connect to database using single instance of connection placed on server that's mean that we will define database connection on the server and open it all the time??
second I want to know what are the benefits of making each application user connect to the same database user (ex. sa)??
if any one know anything bout this subject , please response asap
Thanks,
|
|
|
|
|
rmedo wrote:
first I want to know what are the pitfalls of making all clients connect to database using single instance of connection placed on server that's mean that we will define database connection on the server and open it all the time??
Contention. If more than one user tries to use the database at a time, they will have to wait.
rmedo wrote:
second I want to know what are the benefits of making each application user connect to the same database user (ex. sa)??
It means you can more easily set up a connection pool, because all connections are usable by everyone. It also means that it's easier to set up the database, because there's no real permissions layer. However, this means you need to enforce your permissions in code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for your response,
i want to know if it better to connect all application users to same database user or there is will be a database user for each application user
|
|
|
|
|
It's better to have only one database user, because then you can pool connections, and they can be shared by all users.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I'm working in VS2003 and I've used the Sql DataAdapter Wizard to create a data connection, sql data adapter, stored procedures, and dataset in a winform. I can search and update okay but I get an error when I try to add a new record using the AddNew() Method against the dataset. Any help appreciated.
static void Main()
{
Application.Run(new Form1());
}
private void btnSearch_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.SelectCommand.Parameters["@Param2"].Value = txtBoxSPSearch.Text;
dsStaffPhysicians1.Clear();
sqlDataAdapter1.Fill(dsStaffPhysicians1);
}
private void btnReset_Click(object sender, System.EventArgs e)
{
this.dsStaffPhysicians1.Clear();
ClearStaffPhysician();
}
private void SetupStaffPhysician()
{ //Initialize Staff Physician Page
panel1.Visible = true;
this.cBoxSPLicenseState.DataBindings.Add(new System.Windows.Forms.Binding("SelectedIndex", this.dsStaffPhysicians1, "tblStaffPhysicians.docLicenseState"));
}
private void ClearStaffPhysician()
{ //Clears textboxes and dropdowns
txtBoxSPFirstName.Text = "";
txtBoxSPMiddleName.Text = "";
txtBoxSPLastName.Text = "";
txtBoxSPUpin.Text = "";
txtBoxSPLicenseNumber.Text = "";
txtBoxSPSearch.Text = "";
cBoxSPLicenseState.SelectedIndex = 0;
}
private void menuItem2_Click(object sender, System.EventArgs e)
{ //Main menu -- Staff Physicians
SetupStaffPhysician();
menuItem2.Enabled = false;
}
private void btnUpdate_Click(object sender, System.EventArgs e)
{
this.BindingContext[dsStaffPhysicians1, "tblStaffPhysicians"].EndCurrentEdit();
sqlDataAdapter1.Update(dsStaffPhysicians1);
sqlDataAdapter1.Fill(dsStaffPhysicians1);
}
private void btnInsert_Click(object sender, System.EventArgs e)
{
//Generates Error:System.Data.NoNullAllowedException
//Column 'docLName' does not allow nulls.
this.BindingContext[dsStaffPhysicians1, "tblStaffPhysicians"].AddNew();
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
private void btnCommit_Click(object sender, System.EventArgs e)
{
//will need to do something here to commit insert
}
}
}
|
|
|
|
|
The problem is in the underlying schema for the database. You either need to change the properties of the field 'docLName' to allow null values, or provide a value in the addnew()
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 responding; I'd rather not change the schema if possible. Can you tell me how to 'provide a value in the addnew()'? I've been all over the MSDN and don't have a clue how to proceed. Any help greatly appreciated.
|
|
|
|
|
hi, i have a datagrid with a size = 280; 216 and a PreferredColumnWidth = 120
i have 2 columns!
if i write some text in row nr 7 you can see a vertical scrollbar on the left side!
so i must set a smaller PreferredColumnWidth:
<br />
private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)<br />
{<br />
if(dataGrid1.CurrentRowIndex == 7) && some text ist entered....!?<br />
{<br />
dataGrid1.PreferredColumnWidth = 20;<br />
}<br />
}<br />
but nothing change;-(
cu
|
|
|
|
|
Could you tell me what books like Real World .NET Application ?
The book has some good application for learning.
Thanks in advance
|
|
|
|
|
I searched in Google for that book to see what you were talking about, and I couldn't find it.
However, I don't think a book can help you learn much. Sure, you'll learn the basics (I myself have many books from which I've learned the basics for many technologies), but for more advanced knowledge, you have to sit down, roll up your sleeves and do it.
If you want to really learn, I'd say that you set your self a difficult goal (writing a more or less big application, that uses different things -- a smart client app and a web app, both working on a remote database for example). Trying to accomplish something, as opposed to reading about it, will really make you learn.
If you want to learn about the architecture side of an application, MSDN[^] has several good articles and advanced sample applications.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Hi All,
I've try to send a Microsoft Access Database file through the network, sending the file works fine with the same length of the original. The problem is when I try to open the file at the client side a message appears (“unrecognized database format ").
Any help please, Thanks
Kind Regards,
Mohammad
|
|
|
|
|
How do you send the file?
---
b { font-weight: normal; }
|
|
|
|
|
// Server Side.
FileInfo file = new FileInfo("Inventory.mdb");
// Send the file lenght to the client.
this.client.Send(Encoding.ASCII.GetBytes(""+file.Length));
// Send only database.
FileStream MyFile = new FileStream("Inventory.mdb", System.IO.FileMode.Open);
byte [] output = new byte[file.Length];
// Reading the file.
MyFile.Read(output, 0, (int)file.Length);
MyFile.Flush();
// Send the file to the client.
this.client.Send(output);
MyFile.Close();
---------------------------------------------------------------------------------------
// Client Side.
// Recieve the file length
input = new byte[1000];
int length = this.server.Receive(input);
length = int.Parse(Encoding.ASCII.GetString(input,0,input.Length));
// Receive the file.
input = new byte[length];
length = this.server.Receive(input);
// Create the Backup file.
FileStream myDataBase = new FileStream("CopyofInventory.mdb",System.IO.FileMode.Create);
myDataBase.Write(input,0,input.Length);
myDataBase.Close();
Thanks,
Mohammad
|
|
|
|
|
From what I can tell from the code, you read 1000 bytes into the array input, then parse the length from he beginning of that. If the length occupies the first 6 bytes of the stream, you will be discarding the first 994 bytes of the actual database file.
---
b { font-weight: normal; }
|
|
|
|
|
I want to use VC++ *.lib into C# application. I know that I must compile the lib in to a dll. How can i do that? Any method and hits to me.
|
|
|
|
|
One way is to create a new .NET project called Class Library and copy over your VC++ code. Sometimes the "It Just Works" effect will be able to translate the code. Then when you compile it, you will have your dll which you can make other projects reference. The easier way would be to open the .lib project in VC++ 6.0 and go into Project->Settings and change the output from a static library (.lib) to a dynamic library (.dll). Compile it in VC++ 6.0 to get your .dll file, which your .NET project will be able to reference.
|
|
|
|
|
As the other reply says, I would link your static library (.LIB) into a regular DLL using Visual C++ 6.0. Then I would use P/Invoke to call into the unmanaged DLL from .NET.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
I'm trying to serialize a tree-like structure, and I get a System.InvalidOperationException: "When serializing an object of type RTBranch, a circular reference was found".
I've trached this to a public property which I don't want to be serialzed anyway, but the compiler says I can't apply the [NonSerializable] attribute to this. Removing the property fixes the problem (but obviously that's not what I want )
So far, the data only has a single branch (the root), but RTBranch has a public property AllBranches { get }which (recursively) returns all branches (i.e. this and all child branches, child child branches) in an ArrayList.
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|