|
I have created a set up project for my application and it works great. Now I want to run some SQL Queries during installation to create a database on the target machine. How can I do this?
|
|
|
|
|
|
I am currently working on developing an application that needs to have the client automatically receive changes to the back end database. The back end db is a SQL2005, with the DAL on a second server to query the SQL and an AS-400. The clients are windows forms. I need for the treeviews and datagrids on the windows forms to receive the updates when other users have made changes to the SQL database. The AS-400 is infromational only so I do not need to capture the changes. I ahve been looking at using timers to create a polling routine, but do not feel that they may be the best method. I ahve also looked at the SQL 2005 Notification Service, which would allow me to push the notices to the DAL Server but not to the clients. I am looking for any suggestions as to best practice as I feel this is a common scenerio but have nto been able to find much documentation on the best wayt o handle. The development language is Visual Sturdio 2008 c# with Framework 3.5.
Thanks for any suggestions
Walter
|
|
|
|
|
|
I will look into this to see if it fits my need. thanks for the suggeston
|
|
|
|
|
Just want to mention that constantly keeping clients up to date can be a real killer in overall performance (and also may be in complexity).
However, how the client communicates with the middle-tier?
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
The updates could be done on a timed basis but would rather push the updates down to the clients when there is actually somethign to push. The clents make a call to the DataServer that then uses .Net remoting and web services to tlak to the different back end database servers. The performance concern is why I am looking for a way to have the data published form the server rather then the cleints makeing continous calls to the server if there is nothing there.
The app is a Quote to Order Request system that ties into a legacy system in the end. There are about 30 sales people creating the Order Request, for 3 Order Processors. The Order Processors need to get notified of a request when it comes in. A delay of a few minutes is acceptable on the notification. The request are generated by the Sales in qa SQL 2005 database. The Order Processing system looks at subsets of the data int he SQL 2005 database to allow them to process the request in the AS-400.
|
|
|
|
|
Ok, good info, thanks.
But actually I meant to ask what technology is used when communicating between client and middle tier. Is it Web Services, WCF or something else?
If you need to push the info to the client and you have database connection only at middle tier, I believe that the solution for the client is technology dependent.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
The communication between the client and middle tier is .net remoting.
|
|
|
|
|
OK, the title is a bit confusing so let me explain what I want to do.
I'm looking to write an application that sends keystrokes so that the Windows XP "idle timer" gets reset to prevent a screensaver from starting.
I have tried writing an application that sends keystrokes to itself, but that does not do the trick. I'm guessing that the events need to come from a lower level in the system. So, I'm wondering if/how this can be done.
Thanks in advance for any help.
|
|
|
|
|
At a guess you;ll need to set up a global keyboard hook to do that. Hooking the read event will let you access input to any application which mean's you're tying into a low level OS component, afaik the send event is at the same level.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Why not just disable the screensaver while your program is running? As shown here[^] or maybe here[^]
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hello!
I've created a static class (S) that is extended by a dynamic class (D) during run-time. That means D inherits S and appends some new properties to it, by using System.Reflection.Emit (thanx to the great articles here).
How do I reference the class that does _not_ exist at compile-time? The following article for example, shows how to bind methods. But in that example, the class itself does exist and thus can be found by the compiler. http://msdn.microsoft.com/en-us/library/k3a58006.aspx[^]
Cheers!
Hendrik
|
|
|
|
|
hi guys! what's up
here is my question..
hi!! i made an application and i want to save into my databae the datas from some textboxes. when i click the save button the datas are being normally or at least that's what i thought...
sometimes tha datas are being displayed sometimes not. for example, i run visual studio 2008 c# at 8 pm. and i can see the datas which i inserted before, i close studio,,, after a while i run again studiio and tha datas have gone....Frown
the code is correct..
Please help me guys, i really need your help.
sorry for my english
here is the comands
private void InitializeCommands()
{
//INSERT
dataAdapter.InsertCommand = conn.CreateCommand();
dataAdapter.InsertCommand.CommandText =
"SET IDENTITY_INSERT Producer ON insert into Producer(Pid,AFM,LastName,FirstName,City,ZipCode,Adress) values(@Pid,@AFM,@LastName,@FirstName,@City,@ZipCode,@Adress)";
AddParams(dataAdapter.InsertCommand, "Pid", "AFM", "LastName", "FirstName", "City", "ZipCode", "Adress");
//UPDATE
dataAdapter.UpdateCommand = conn.CreateCommand();
dataAdapter.UpdateCommand.CommandText =
"update Producer set AFM=@AFM, LastName=@LastName, FirstName=@FirstName, City=@City, ZipCode=@ZipCode, Adress=@Adress where Pid=@Pid ";
AddParams(dataAdapter.UpdateCommand, "Pid", "AFM", "LastName", "FirstName", "City", "ZipCode", "Adress");
//DELETE
dataAdapter.DeleteCommand = conn.CreateCommand();
dataAdapter.DeleteCommand.CommandText =
"delete from Producer where Pid = @Pid";
AddParams(dataAdapter.DeleteCommand, "Pid");
}
the add paremateres method
private void AddParams(SqlCommand cmd, params string[] cols)
{
foreach (string col in cols)
{
cmd.Parameters.Add("@" + col, SqlDbType.NVarChar, 0, col);
}
}
the insert button
private void btnAdd_Click(object sender, EventArgs e)
{
insertRec = true;
DataRow row = dt.NewRow();
dt.Rows.Add(row);
//MessageBox.Show(totalRec.ToString());
totalRec = dt.Rows.Count;
curRec = totalRec-1;
row["Pid"] = totalRec;
txtpid.Text = totalRec.ToString();
txtAFM.Text = "";
txtln.Text = "";
txtfn.Text = "";
txtCity.Text = "";
txtZip.Text = "";
txtAdr.Text = "";
btnSave.Enabled = true;
}
and the save button
private void btnSave_Click_1(object sender, EventArgs e)
{
DataRow row = dt.Rows[curRec];
//MessageBox.Show(totalRec.ToString());
//MessageBox.Show(curRec.ToString());
row.BeginEdit();
row["Pid"] = txtpid.Text;
row["AFM"] = txtAFM.Text;
row["LastName"] = txtln.Text;
row["FirstName"] = txtfn.Text;
row["City"] = txtCity.Text;
row["ZipCode"] = txtZip.Text;
row["Adress"] = txtAdr.Text;
row.EndEdit();
dataAdapter.Update(ds, "buffer");
ds.AcceptChanges();
CreateDir();
ToggleControls(true);
insertRec = !true;
}
i havevreated the dataset,dataadapter, the conection string and the datatable of cours
|
|
|
|
|
Double posting won't give you twice as many answers compared to posting only once. More likely the amount is 1/(NumberOfRepeats).
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
ASALAMOALEKUM all,
hope everyone is fine!
i hav a task to accomplish as soon as possible by the end of october, due to other projects i was unable to work on this uptil now and if now i start my search from scratch it will consume too much time as i know its not a small task...
i want to make video indexer...
for which i wana know libraries for video/audio editing in C#
i have tried my best for searching .NET SDKs (my requiremnt) which help me extracting audio from video, calculating frequency time values of sound of video but i didnt find any such which may help!
please if anyone of you have any idea do help me i will be verythankful to u!
thanks in adv.!
regards,
SANA AHMAD
GOD BLESS US!
$@N@
|
|
|
|
|
.NET does not natively support audio/video editing. You will have to resort to using .NET compliant third-party SDKs such as DirectX.
Regards,
Thomas Stockwell
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.
Visit my Blog
|
|
|
|
|
|
hi guys! what's up
here is my question..
hi!! i made an application and i want to save into my databae the datas from some textboxes. when i click the save button the datas are being normally or at least that's what i thought...
sometimes tha datas are being displayed sometimes not. for example, i run visual studio 2008 c# at 8 pm. and i can see the datas which i inserted before, i close studio,,, after a while i run again studiio and tha datas have gone....Frown
the code is correct..
Please help me guys, i really need your help.
sorry for my english
here is the comands
private void InitializeCommands()
{
//INSERT
dataAdapter.InsertCommand = conn.CreateCommand();
dataAdapter.InsertCommand.CommandText =
"SET IDENTITY_INSERT Producer ON insert into Producer(Pid,AFM,LastName,FirstName,City,ZipCode,Adress) values(@Pid,@AFM,@LastName,@FirstName,@City,@ZipCode,@Adress)";
AddParams(dataAdapter.InsertCommand, "Pid", "AFM", "LastName", "FirstName", "City", "ZipCode", "Adress");
//UPDATE
dataAdapter.UpdateCommand = conn.CreateCommand();
dataAdapter.UpdateCommand.CommandText =
"update Producer set AFM=@AFM, LastName=@LastName, FirstName=@FirstName, City=@City, ZipCode=@ZipCode, Adress=@Adress where Pid=@Pid ";
AddParams(dataAdapter.UpdateCommand, "Pid", "AFM", "LastName", "FirstName", "City", "ZipCode", "Adress");
//DELETE
dataAdapter.DeleteCommand = conn.CreateCommand();
dataAdapter.DeleteCommand.CommandText =
"delete from Producer where Pid = @Pid";
AddParams(dataAdapter.DeleteCommand, "Pid");
}
the add paremateres method
private void AddParams(SqlCommand cmd, params string[] cols)
{
foreach (string col in cols)
{
cmd.Parameters.Add("@" + col, SqlDbType.NVarChar, 0, col);
}
}
the insert button
private void btnAdd_Click(object sender, EventArgs e)
{
insertRec = true;
DataRow row = dt.NewRow();
dt.Rows.Add(row);
//MessageBox.Show(totalRec.ToString());
totalRec = dt.Rows.Count;
curRec = totalRec-1;
row["Pid"] = totalRec;
txtpid.Text = totalRec.ToString();
txtAFM.Text = "";
txtln.Text = "";
txtfn.Text = "";
txtCity.Text = "";
txtZip.Text = "";
txtAdr.Text = "";
btnSave.Enabled = true;
}
and the save button
private void btnSave_Click_1(object sender, EventArgs e)
{
DataRow row = dt.Rows[curRec];
//MessageBox.Show(totalRec.ToString());
//MessageBox.Show(curRec.ToString());
row.BeginEdit();
row["Pid"] = txtpid.Text;
row["AFM"] = txtAFM.Text;
row["LastName"] = txtln.Text;
row["FirstName"] = txtfn.Text;
row["City"] = txtCity.Text;
row["ZipCode"] = txtZip.Text;
row["Adress"] = txtAdr.Text;
row.EndEdit();
dataAdapter.Update(ds, "buffer");
ds.AcceptChanges();
CreateDir();
ToggleControls(true);
insertRec = !true;
}
i havevreated the dataset,dataadapter, the conection string and the datatable of cours
|
|
|
|
|
If you're using an Access database as part of your project, you application is modifying a copy of the database made in the bin folder of your project. WHen you come back to the project and run it again, the .MDB file in the bin folder is overwritten with the copy of the database as it was when you added it to the project.
|
|
|
|
|
ok,i solve it, hank you very much
|
|
|
|
|
Is there C# code that will take an image and a list of RGB values and make the image out of the RGB colors with floyd steinberg dithering?
|
|
|
|
|
afjepoifesahie wrote: there C# code that will take an image and a list of RGB values and make the image out of the RGB colors with floyd steinberg dithering?
Is there some problem Googling for "floyd steinberg dithering c#" for examples and libraries?
|
|
|
|
|
But that would be too easy. Clearly this person likes a challenge!
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I'm needing a little help figuring out the best way to check if a table exist in an access DB and then set a flag to create the Table. I want to set this up with reusable code.
right now i am setting the commandtext with the SQL query that I want to convert to varaibles but want to figure out how I want to do this first because it is most likely part of the overall solution for this.
I'm opening the Database reading the GetSchema and reading each table name and have an array of my tables that the program is going to create, I can compare these but I'm getting lost on how to keep three array's in sync with out putting in individual checks for each table. yes the code below only has 5 tables but this application is going to grow in future versions and i don't want to have to go back and recode this or add checks for each table.
string[] NATables = new string[5];
NATables[0] = "Group Policy";
NATables[1] = "GPO Computer Settings";
NATables[2] = "GPO User Settings";
NATables[3] = "GPO Links";
NATables[4] = "GPO Delegation";
String connect = "Provider=Microsoft.JET.OLEDB.4.0;data source=.\\Test.mdb";
OleDbConnection con = new OleDbConnection(connect);
con.Open();
OleDbCommand cmd = con.CreateCommand();
DataTable dt = con.GetSchema("tables");
con.Close();
DataRow[] rows = dt.Select();
for (int i =0; i < rows.Length; i++ )
{
string r = rows[i]["TABLE_NAME"].ToString();
for (int j = 0; j < NATables.Length; j++)
{
if (r == NATables[j])
{
}
else
{
}
}
}
con.Open();
cmd.CommandText = "CREATE TABLE [Group Policy]([GPO GUID] Text(50) NOT NULL Unique PRIMARY KEY,[GPO NAME] TEXT(50) NOT NULL,[GPO Domain] TEXT(50) NOT NULL,Created datetime NOT NULL,Modified datetime NOT NULL,Status TEXT(10) NOT NULL)";
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
|
|
|
|
|