|
Hi,
ASP.NET Datagrid has an event known as ItemDataBound event. Basically this event will get fired when each row is binding to the datagrid.
So for displaying the image button and label, you can itemtemplate of the datagrid and for databinding to these controls, you can use ItemDataBound event
The syntax of ItemDataBound event is given below
private void YourDataGridName_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
//Here you should get the dynamic data from Database/file system etc. and bind to the controls
}
--Rakheesh
|
|
|
|
|
Hi all,
we have a singleton class which has some functions used to do testing a harware.
Our main Exe will create an object for that singleton class(which opens Com1 port and communicate with hardware). so the Exe will do communication test with hardware it is working well. We are using one testing tool (teststand)(a COM EXE)to do various testing with hardware, Testing tool provided some class libraries to execute test profiles . Main exe will use these libraries to execute tests when the user clicks Testbutton. after that testing tool(teststand) try to create an object for that singleton but it returns new object not the existing one which is created by EXE. So it throwing me exeception "Com1 port access denied." (since we created object for signleton class @ very first in EXE)
My question is Since that testing tool runs in a separate Appdoamin will the singlton class create separate object for different appdomain? if so is there any solution to reslove this?
Hope i clearly explained my probs.
Thanks in advance
Srini
|
|
|
|
|
The library is loaded separately for each application, so you can't share a singleton between applications.
---
b { font-weight: normal; }
|
|
|
|
|
I need convert byte[] to system.Drawing.Image
This code Download Image from URI , i need put image in pictureBox after Downloaded .
WebDownload webDL = new WebDownload();
byte[] downloadedData = webDL.Download(DownloadUrl, ProgressCallback );
CompleteCallback( downloadedData );
ImageDisplay ds = new ImageDisplay();
ds.pictureBox1.Image = (Image)downloadedData;
help me ...
-- modified at 2:00 Wednesday 9th August, 2006
|
|
|
|
|
How about this:
byte[] data = new byte[5] {1, 2, 3, 4, 5};
MemoryStream memoryStream = new MemoryStream(data);
Image img = Image.FromStream(memoryStream);
|
|
|
|
|
thank you Man , I love you
|
|
|
|
|
hi all ,
there are 4 field (name , family name , ave , stNumber )in my table . for this , in my form(form1) I've 4 CheckBox Control . I want to take a report whenever the user select one or two or ... of them . for example , if the user checked CheckBox1(for the name field ) and CheckBox2(for the family field) , In outpout report show , name and family . how can i dot with crystal report ?
plz help me .
s_mostafa_h
|
|
|
|
|
my table?
if you user datagrid,maybe it's easy to do
|
|
|
|
|
can you more explain or give a sample or ...
regards,
|
|
|
|
|
rainfeet: if you user datagrid,maybe it's easy to do
How ?
-- modified at 8:06 Wednesday 9th August, 2006
s_mostafa_h
|
|
|
|
|
Hi all,
I had SQL Server 2005 EXPRESS installed in my Computer (WIN XP) and I have just got SQL SERVER 2005 Enterprize edition. Now, I wanted to install SQL ENTERPRIZE but I got message that, a SQL Server instance is running so .etc.. and failed. So My point is, I want to develop Windows application using SQL Server Express 2005 so that it is easy to ship and free to distribute. But I want to have SQL Server Enterprize for Web Development purpose and other reasearch work. Is it not possible to keep both of them at the same time ?
AND .. CAN I USE SQLEXPRESS WITH VISUAL STUDIO 2005 PROFESSIONAL ?
Thanks
EMRAN
-- modified at 23:34 Tuesday 8th August, 2006
|
|
|
|
|
Hello
emran834 wrote: Is it not possible to keep both of them at the same time ?
As far as I know it's possible. You can install multiple SQL servers on a single machine using different instance names. Maye you should post the whole error message. And of course I don't think I have to remind you that you should close Visual studio and/or any other program using SQL server.
emran834 wrote: CAN I USE SQLEXPRESS WITH VISUAL STUDIO 2005 PROFESSIONAL ?
Sure!! Why not?? I do it all the time
Regards
|
|
|
|
|
how to retrieve motherboard serial number of own machine?
|
|
|
|
|
That depends on if the manufacturer provided WMI classes to supply this information. Most don't. On top of that, the information has to be provided by the motherboard. Again, most don't provide this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello
Retrieving such information can not be done using C# usually. You'll have to either use interrupts - eg. INT21H- or access BIOS directly. Both of which requires good knowledge of assembly language, and a hardware background. Also if it's possible in one motherboard, it could be not in another, ie. it's a hardware specific procedure with quite some variations.
Regards
|
|
|
|
|
|
Hai Friends
Is there any sample/ Open source or Article that decribes how to code ISO 8583 Formatter in C#.
Please help me . its so urgent.
Thanks in advance
|
|
|
|
|
The above code (C#)works as fare as the MessageBox.Show("The name of the second column is " + colSecond.ColumnName); can answer the question so the connection to the database is okay .. But no data are shown in the datagrid..
Whats wrong.. guess its something to do with the databinding ??
MySqlConnection cnnVideos = new MySqlConnection("Database=tiebreak;Data Source=localhost;User Id=root;Password=test");
cnnVideos.Open();
string strVideos = "SELECT * from member;";
MySqlCommand cmdVideos = new MySqlCommand(strVideos, cnnVideos);
MySqlDataAdapter dadVideoCollection = new MySqlDataAdapter(cmdVideos);
DataSet setVideos = new DataSet("member");
dadVideoCollection.Fill(setVideos);
dataGrid1.DataSource = setVideos;
dataGrid1.DataMember = setVideos.Tables[0].TableName;
dataGrid1.SetDataBinding(setVideos, "member");
DataColumn colSecond = setVideos.Tables[0].Columns[2];
MessageBox.Show("The name of the second column is " + colSecond.ColumnName);
cnnVideos.Close();
-- modified at 20:26 Tuesday 8th August, 2006
|
|
|
|
|
dataGrid1.SetDataBinding(setVideos, "member");
see !you can chang the sequence like dataGrid1.SetDataBinding("member",setVideos);
|
|
|
|
|
Hmm excuse me, but I didn't understand your reply ..
First of all, I currently had it like dataGrid1.SetDataBinding(setVideos, "member"); .. And no I cant change the order, it will give compile errors.. ? what where the problems that you saw ?
|
|
|
|
|
Tried to add the following:
DataSet setVideos = new DataSet("setVideos");
setVideos.Tables.add(new DataTable("name"));
setVideos.Tables.add(new DataTable("adress"));
but it returns the following error:
System.Data.DataTableCollection' does not contain a definition for 'add'
|
|
|
|
|
Hi,
I just know this is a dumb simple question BUT I can't figure it out .
I'm trying to break my code into several codefiles to make it easier to follow. I thought all you had to do was use the same namespace declaration in each of them and then the code/methods in those *.cs files would be freely "interchangeable" and usable.
I've added codefiles using the add to project options in Solution Explorer, used the same namespace in the new codefile but I can't use a method in the main code file that is located in the other codefile.
When I reference the method I keep getting the error "The name 'getYMDHMS' does not exist in the current context".
Can someone be kind enough to put me out of my misery and tell me what I'm doing wrong .
Thanks,
Glen Harvy
|
|
|
|
|
Hmm, when you say you can't use a method in the main code file that is located in another codefile, do you mean that you can't use the class that contains the method in one file in another file?
Let's say you have a file in your project called Program.cs. I'm assuming that we're creating a console application program. Here is what the Program.cs file looks like:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
}
}
}
Now, let's add a second file, actually we'll be adding a second class that will be contained in a second file. We'll call it MyClass.
Go to Project->Add New Item
Choose Class, and type MyClass in the edit box. Then press the Add button.
Visual studio has created a second file for use called MyClass.cs. It looks like this:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class MyClass
{
}
}
Let's add a static method to MyClass that we can call from the Main method in the Program class:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class MyClass
{
public static void PrintHello()
{
Console.WriteLine("Hello!");
}
}
}
Change the Main method in the Program class located in the Program.cs file to look like this:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
MyClass.PrintHello();
Console.Read();
}
}
}
Run the program.
To review: We've created a console application and added a second class called MyClass contained in a second file called MyClass.cs. We called a static method in MyClass from the Main method in the Program class.
Does this example help?
If you need more information, let me know.
|
|
|
|
|
Leslie Sanford wrote: Does this example help?
Are you kidding - without your help I would still be lost .
Leslie Sanford wrote: do you mean that you can't use the class that contains the method in one file in another file?
Yes - that's exactly what I mean BUT I can only say that AFTER I studied your response and then looked up the next error message and discovered the importance of the "static method" located at http://www.vijaymukhi.com/documents/books/csbasics/chap3.htm[^] .
Here's the top part of my "extension.cs" file that I created after following your instructions:
namespace myclubv2<br />
{<br />
class extension<br />
{<br />
public string getYMDHMS()<br />
{<br />
string YMDHMS;<br />
YMDHMS = Convert.ToString(DateTime.Now.Year);<br />
<br />
string sMonth = "";<br />
int Month = DateTime.Now.Month;<br />
if (Month < 10)<br />
{<br />
sMonth = "0";<br />
sMonth += Convert.ToString(DateTime.Now.Month);<br />
}<br />
else
and my "mainform.cs" file:
namespace myclubv2<br />
{<br />
public partial class MainForm : Form<br />
{<br />
public MainForm()<br />
{<br />
InitializeComponent();<br />
extension a;<br />
a = new extension();<br />
string ext = (string) a.getYMDHMS();<br />
MessageBox.Show("YMDHmS is " + ext);<br />
}<br />
<br />
...........<br />
}
Now - the above works but I also note that making the namespace AND the class the same in both files I can do away with the following :
<br />
extension a;<br />
a = new extension();<br />
string ext = (string) a.getYMDHMS();<br />
and just use getYMDHMS();
in my "mainform.cs" file.
I am not sure I really understand all this and I would certainly like it to be explained in plain simple terms. I understood what you told me (I think ) but whilst this may be all simple to most - to a beginner I believe that it deserves an article by itself.
Thanks for your response.
Warm regards,
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: string ext = (string) a.getYMDHMS();
No need for a cast.
Glen Harvy wrote: but I also note that making the namespace AND the class the same in both files I can do away with the following
So you changed the extension class to this?
namespace myclubv2
{
public class MainForm
{
public string getYMDHMS()
{
}
}
}
And in your mainform.cs file, you have something like this?
namespace myclubv2
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
string ext = (string) a.getYMDHMS();
MessageBox.Show("YMDHmS is " + ext);
}
}
}
Glen Harvy wrote: I am not sure I really understand all this and I would certainly like it to be explained in plain simple terms.
Note the "partial" keyword above in the class declaration. Declaring a class as partial allows you to split its declaration across several code files. This helps segragate parts of a class so that a single code file doesn't become so large as to be unmanageable.
For example, when Visual Studio generates code for a Form class, it seperates the code for initializing the controls on the Form in a second code file. This initialization code can be quite verbose, and it helps to have it in its own code file instead of poluting the one in which you'll be writing your own code.
So since Visual Studio declared the MainForm class as partial, and since you changed the name of your extension class to MainForm, the code that was in the extension class is now considered part of the MainForm class. So you can call the getYMDHMS method directly from MainForm.
|
|
|
|