|
Did you install any updates lately? To windows 2003 or any software around? I remember about sum of these issues with Symantec software.
Code? Yeah i love it fried together with a glass of wine.
|
|
|
|
|
Hi,
thanks for your answer. I didn't install any updates. Now I restarted my service and it's working correctly.
Have you any ideas?
|
|
|
|
|
I have developed a C# project which includes a text area and few other items
And I tried to play a background music using a thread.
The program works fine in my home machine,.
But once i tried to run it on different machine, an error occurs,.
So I copied the entire project and I tried to run it on another machine.(That machine had Visual Studio 2005),
And it gave and an error and said that the music file is not accessible.....
But it was there...
Is there a reason for this.
And I've heard that there is a method to include the files(media files, and pictures) into the project so that at the end(after compiling) you just need to carry the .exe, Not .exe file and the other files in its folder.
This would be a great help if any one can help ,me!!!
|
|
|
|
|
Hi,
you could try to add the music file as "Embedded resource" into your project. Than it will be "placed" inside the .exe-file. But accessing the file is different from accessing it as a file on a disk. You have to use something like:
<br />
Stream ioStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("MyNamespace.MySoundfile.wav");<br />
Have a look here http://support.microsoft.com/kb/319292[^]
Hope this helps.
Regards Sebastian
|
|
|
|
|
Thank You very much Sebastian!!!
Thanks for the reply you have given,......
But I still have a small problem, To play the music I have used the
quartz.dll as a reference,
If so how am I gonna use this RESOURCE syntax...
|
|
|
|
|
Hmm, depends on the default namespace of your application.
It should look like:
"MyDefaultNamespace.quartz.dll"
To get the default namespace, open the project settings and navigate to the Application tab.
|
|
|
|
|
i have the following code - what it should do is to retrieve the rows that have the same id but the content within the other columns are not the same.
sqlquery = "select * from " + Table2 + " where " + txt_comkey_tbl2.Text + " in (select " + txt_comkey_tbl1.Text + " from " + Table1 + ")";
dbCmd = new OleDbCommand();
dbCmd.Connection = dbConn;
dbCmd.CommandText = sqlquery;
dbCmd.CommandType = CommandType.Text;
db1Reader = dbCmd.ExecuteReader();
dp = new DataSet();
db1table = dp.Tables.Add(sqlquery);
for (j = 0; j < dbReader.FieldCount; j++)
db1table.Columns.Add(db1Reader.GetName(j), db1Reader.GetFieldType(j));
foreach (DataRow dr in db1table.Rows)
{
for (int i = 0; i < db1table.Rows.Count; i++)
{
if (dr["Name"].ToString() == db1table.Rows[i]["Name"].ToString())
{
if (dr["Value"].ToString() != db1table.Rows[i]["Value"].ToString())
{
// select the row from the database and display in the grid...
}
}
}
}
however when i run the code i don't get any values on the datarow but execute the same sqlquery in the database two rows are returned. is there perharps something that is not done correctly?????
|
|
|
|
|
Hi Melanie,
is the sqlquery-text correct (I mean are the values you are using correct).
Next question I have i, why aren't you using the db1Reader like this:
<br />
while(db1Reader.Read()) {<br />
<br />
}<br />
I don't see the point where you putting the Values from the db1Reader into the db1table. So I assume that db1table has no rows...
Hope this helps.
Regards
Sebastian
|
|
|
|
|
Aside from the other post, you really need to not build SQL queries like that. You're very prone to someone injecting something that would compromise the system.
Do some searches on articles here at CodeProject regarding SQL Injection to find some tips on how to resolve the above issues.
|
|
|
|
|
You can use controls in a loop using FindControl(string name) (self made method).
However i would like do a loop with objects like:
string str1 = "test"
string str2 = "test"
string str3 = "test"
for (int i = 0; i < 5; i++)
{
str[i].Text = "test2";
}
Also tryed:
string new = (string)str[i];
Also didn't work.
Any idea/methods for doing something like this?
Thanks
|
|
|
|
|
No, you can't create a few objects named like this and then try and iterate through them like they are in an array.
Either add them to a collection, and iterate through that:
String str1 = "test";
String str2 = "test";
String str3 = "test";
List<string> strings1 = new List<string>();
strings1.Add(str1);
strings1.Add(str2);
strings1.Add(str3);
for (int i = 0; i < 3; i++)
{
strings1[i] = "test2";
}</string></string> Or create an array of them to begin with:
String[] strings2 = new String[3];
strings2[0] = "test";
strings2[1] = "test";
strings2[2] = "test";
for (int i = 0; i < 3; i++)
{
strings2[i] = "test2";
}
Simon
|
|
|
|
|
Aha yes i figured as much.
Thanks anyway.
|
|
|
|
|
Hi,
I have upload an image in to image column but i have no idea to get it from DB and displaying it in Image control or Bitmap.Is it possible to display?Then plz guide me...
|
|
|
|
|
|
Hi
Thanx for that link but it uses file to store and retrieve.Is it same for database retrieval.And also i want that image to display in some specific area of my page .
|
|
|
|
|
It stores data in database. In order to show it on form you can use Image.FromStream method to construct the image after you read data from database in stream.
|
|
|
|
|
K thanks i will check it out...
|
|
|
|
|
do you what to display images store in a database? search here in codeproject for samples. If you get stuck in debuging or for something else ask here, we help.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi,
I want to write a some data, as well read it from USB port.
I am able to write the data, But unable to read it. Even the
SerialDataReceivedEventHandler is not firing an event.
I am getting TimeOut exception. Please help me to solve the problem.
Reagards
Shiva
|
|
|
|
|
I think you have to check what kind of a device it is,
HID devices uses in and out -put reports.
Not really an answer but i hope it helps you a little further.
|
|
|
|
|
hi,
how to add control like button from one Form to another Form at runtime?
i have tried this one :
Form2 objForm2 = new Form2();<br />
objForm2.Controls.Add(this.button3);
i think button3 add on Form2 with successfully but.......new added control "button3" not shown on Form2 why?
|
|
|
|
|
A GUI control can't appear on two forms at the same time.
Just like you can't have the same button appear twice on one form. A GUI control has only 1 visual representation at a time. If you want two buttons you need to create 2 buttons, not try and use the same button twice.
(You can create 2 buttons and attach them both to the same event handlers if you want them to call the same code)
Simon
|
|
|
|
|
i used following code:
frmTimetablePopup objfrmTimetablePopup = (frmTimetablePopup)Application.OpenForms["frmTimetablePopup"];<br />
DataGridView grd = new DataGridView();<br />
grd.Name = "grd";<br />
grd.Location = new Point(310, 300);<br />
grd.Size = new System.Drawing.Size(600, 600);<br />
DataGridViewTextBoxColumn grdCol = new DataGridViewTextBoxColumn();<br />
grdCol.HeaderText = "Days";<br />
grdCol.Name = "Col1";<br />
grdCol.Width = 50;<br />
grdCol.DefaultCellStyle.BackColor = Color.CornflowerBlue;<br />
grd.Columns.Add(grdCol);<br />
objfrmTimetablePopup.Controls.Add(grd);
but fail ........
|
|
|
|
|
You're code works fine for me. You're setting the location to 310,300. Is this off the edge of your form.
grd.Location = new Point(310, 300); Try setting it to 0,0 instead.
Simon
|
|
|
|
|
believe me it's does not work.......
objfrmTimetablePopup.Controls.Add(grd);
after run the above coding.......objfrmTimetablePopup contains the "grd" but where ? i don't know
|
|
|
|