|
hi
i need an example how to work with datagrid in C#
lets say i have table in SQL server that called Stock_ID
and one of the collumn is Symbol
how can i get the value of the Symbol from the datagrid
lets say i awnt to display all Symbols
thanks
eyalso
|
|
|
|
|
|
protected void get_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("server=lzq;database=pubs;uid=sa;pwd=");
SqlDataAdapter da = new SqlDataAdapter("select * from lzq", conn);
DataSet ds = new DataSet();
da.Fill(ds, "t1");
datagrid1.DataSource = ds.Tables["t1"].DefaultView;
datagrid1.DataBind();
}
|
|
|
|
|
I have made an application where the user may set the Desktop Wallpaper.
Using the method:
WinAPI.SystemParametersInfo(SPI_SETDESKWALLPAPER, 1, fileName, SPIF_SENDCHANGE);
everything works fine, until I restart the computer.
How do I make the new wallpaper survice a computer restart ??
|
|
|
|
|
try this:
private const int SPIF_SENDWININICHANGE = 0x2;<br />
private const int SPIF_UPDATEINIFILE = 0x1;<br />
<br />
WinAPI.SystemParametersInfo(SPI_SETDESKWALLPAPER, 1, fileName, SENDWININICHANGE ||SPIF_UPDATEINIFILE);
I am pretty sure this is what I am using for my Desktop Radnomizer program that I wrote.
Regards,
1tg46
Check out 3D Game Development with Dark Basic Professional [^]programming.
|
|
|
|
|
How do set column of crystal report dynamic by user?? isn't possible to do that??
angela
|
|
|
|
|
I am facing a problem in Date format in our project. This problem exists only for the month of March.
Our client machine,server machin and DB server machine are in German OS.
In German language, the name of the month for March is 'MÄRZ' (which contains a spl character 'Ä'). The middle tyre of our project will support only the date format 'dd-MMM-yyyy' , example 25-Jan-05. While converting the date of month March in .NET, it is not understanding the spl character and convert the month as 'Mrz', for example
'25-Mrz-05'. But Oracle and SQL Server can understand only MÄR and not Mrz. So, in the month of march we are getting so many exceptions in our project.
We got a temprary soluntion in SQLServer. But we yet to find a solution in Oracle. Kindly help me to resolve this.
With Love
Siva.
|
|
|
|
|
Hi!
The problem is not that the 'ä' is "not understood" by .NET while converting the month, it's just that the short 3-letter form .NET uses for march in German is "Mrz".
Although I must admit that I've never tried to feed localized dates to SQLServer (or Oracle), it's hard to believe that the DB systems are choking on this because "Mrz" is a very common abbreviation for März here in Germany, even though it's the only one not taking the first 3 letters of the month's name.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Where does the date come from, and how do you convert it?
Why do you handle the date as a string, and not as a DateTime?
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa,
The date come from my date picker control.I am not handling as a string.
The middle tyre of my project should support only the format dd-MMM-yyyy.
So, i am converting whatever the date i selected in date picker control to the above said format.
With Love
Siva.
|
|
|
|
|
If you don't handle the date as a string, it doesn't have a format. A date value only gets a format when you convert it into a string. If you don't convert it to a string, there is no way of specifying a format.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
can any please help me with the following,
How to Convert a System.Drawing.Bitmap object to stdole.IPictureDisp() object.? or How to put a picture on a Button Created in outlook.?
Thanks in Advance
kss
|
|
|
|
|
Hi frnds,
I have dynamically created dropdownlist control on my web page and tried to create an event like..
DropDownList DDL = new DropDownList();
DDL.ID="DDL"+i.ToString();
DDL.AutoPostBack=true;
DDL.SelectedIndexChanged += new System.EventHandler(this.DDL_selectFontFamily);
void DDL_selectFontFamily(object sender, System.EventArgs e)
{
DropDownList DDL = (DropDownList)PlaceHolder1.FindControl("DDL0");
string FFamily = DDL.SelectedItem.Value;
Response.Write(FFamily);
}
but it is not working. Infact the control is not going into DDL_selectFontFamily()...saying that DDL is out of scope.
Plz help me out guys.
Abhishek
|
|
|
|
|
|
hi
my application needs the merging of two images.
Actually when iselct a picturebox the image in the picturebox should merge with the photo captured and shown in another picturebox from the web cam . can anyone help
thanks
|
|
|
|
|
|
Dear all,
Im using a class named Events where i have some property like
CLass Events
{
private string _EvDate;
public string EvDate
{
get{ return _EvDate }set { _EvDate = value;}
}
}
I have one more class as below
Class EventProp
{
private string _TZid;
then get set
}
Requirement is EvDate has attributes such as TZID, So i want to set the attribute value from the Events, that is
EvDate.Tzid = some vlaue from some function();
Please help me out to solve this problem.Thank you in advance for the solution for my problem.
Regards
Mukil
|
|
|
|
|
I am sorry, but EvDate itself is an attribute of the Events class
how can u create an attribute for it?
u can set a value to EvDate by creating an object of the events class
Events ev = new Events();
ev.EvDate = Some value from some function();
regards,
Pramod
|
|
|
|
|
Thank you very much for your kind reply. Yes whats u told is right.
Thank you once again.
Regards
Mukilan.P.S
Regards
Mukilan.P.S
|
|
|
|
|
hi
Iam working on c# windows application . I want to capture video clips or moving images from web cam and not photos.can anyone help .
thank u
ramya
|
|
|
|
|
i think this will help u
http://www.codeproject.com/csharp/Motion_Detection.asp
Regards,
Pramod
|
|
|
|
|
I am attempting to write a form serialiser in C#, it is a Visual Studio .Net 2005 addin.
My current problem is getting what methods are set as bound to events on a control. For example, i bind button1_click(..) to button1, i can iterate
through all the events in System.Windows.Forms.Button just fine, however i have not been able to determine how to find out what delegates that event
has bound to it.
Current code:
private void GetEvents(string type, object oControl, int controlId)
{
Type t = oControl.GetType();
EventInfo[] events = t.GetEvents();
foreach (EventInfo evnt in events)
{
object value = envt;
}
}
Setting of value was simply for me to drop a break point on to play with the EventInfo object..
Any assistance or links to a guide would be most welcome.
- Mark Harris
|
|
|
|
|
I see you haven't gotten any response.
There's an EventHandlerType property in EventInfo that you can use to (according to MSDN):
A read-only Type object representing the delegate event handler.
You can create a delegate of that type like this:
dlgt=Delegate.CreateDelegate(ei.EventHandlerType, eventSink, mi.Name);
However, what you want is a list of the event handlers, right?
You will want to use GetInvocationList on the event itself:
event FooDlgt FooEvent;
...
foreach(Delegate dlgt in FooEvent.GetInvocationList())
...
Hopefully this is enough information to either create a delegate of the correct type or scan the invocation list.
Marc
Pensieve
Functional Entanglement vs. Code Entanglement
Static Classes Make For Rigid Architectures
|
|
|
|
|
Well, after giving myself a rather large headache over the last 2 days trying to work this out, i have come up with nothing. I just can't work this out, and I have to demo the software to the staff here tuesday next week!
So here is what I'm having problems with as far as this goes:
GetInvocationList looks like EXACTLY what I need, however i can't call it, as i dont have an event to call it on.
Due to the fact that this is a serialiser, i'm going over every control on the form with code somewhat similar to this:
GetControls(_form, 0);
private void GetControls(object oControl, int parentId)
{
if (((Control)oControl).Controls.Count > 0)
{
foreach (Control childCtrl in ((Control)oControl).Controls)
{
GetProperties("control", childCtrl, control_id);
GetEvents("control", childCtrl, control_id);
GetControls(childCtrl, control_id);
}
}
}
GetEvents is defined:
private void GetEvents(string type, object oControl, int controlId)
Since this control could be any type of control i get the events on it:
Type t = oControl.GetType();
EventInfo[] events = t.GetEvents();
and then loop through them
foreach (EventInfo evnt in events)
{
}
Now I have an EventInfo for hte object. From this I can create a delegate if I'm so inclined (dlgt = Delegate.CreateDelegate(evnt.EventHandlerType, mi ); ) however, I get the problem of where does MemberInfo come from? I can't get it from the class that the control is in, because I don't know what this event needs to be bound to (moreover, this is what i'm actually trying to find out).
I'd really love any ideas you have or if you could just point out where I'm going wrong (if the entire concept is not incorrect).
|
|
|
|
|
Hello,
I've been trying to make a program that can basically return the contents of an image to paint via the File/Open dialog.
So you'd open Paint, hit file-->Open and then either
1. Select my program which returns an image somehow or
2. Select my file type which does something else! (What I don't know!)
What I'd like to do is have a shortcut type program that pulls files from a database rather than the filesystem.
Maybe I should be asking how do .lnk files tell paint to get the file from somewhere else?
Any ideas?
Thanks
Gareth
|
|
|
|