|
great it worked!!!
stupid me
probably i had confused .net by same names
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
Im well aware that there are a gazillion of AOP inspired samples out there that show how to intercept ContextBoundObject.
ServicedComponent inherits ContextBound, but none of those examples works when applied to SC.
Have anyone done this?
I pretty much only want to log parameters and do some basic serup when a method is called.
|
|
|
|
|
A database having two tables, Company and Cust.
Company feilds : Cid, Cname
Cust Feilds: custId, custName, Cid(same as Company)
I bound the Company:Cname to a combobox,
I want to write a query like:
"select * from Cust where [Cid]= ???"
???=(here the Cid of selected Cname from comboBox)
how to get the corresponding Cid feild of combobox selected Cname??
|
|
|
|
|
Set Cid as the valuemember for the combo and Cname as the display member. Then the where clause will become - "where Cid = combobox.selectedvalue"
Hope it helps.
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
Thanks for replying.
d@nish wrote: where Cid = combobox.selectedvalue"
I also had tried this, but its giving error "Datatype mismatch in criteria exprssion"
Also when i debug the query, comboBox.SelectedValue gives the index value of selected item, not the Cid feild value from Company table.
any suggestion or link u can fwd me.
|
|
|
|
|
assuming you've set the DataValueField member when databinding...
<br />
combobox.SelectedValue<br />
|
|
|
|
|
Eduard Keilholz wrote: assuming you've set the DataValueField member when databinding...
I had set the comboBox.DisplayMember = "Cname" (name of company)
comboBox.Valuemamber="Cid" (id of company)
but still not ok??
Eduard Keilholz wrote: combobox.SelectedValue
I also had tried this, but its giving error "Datatype mismatch in criteria exprssion"
Also when i debug the query, comboBox.SelectedValue gives the index value of selected item, not the Cid feild value from Company table.
any suggestion or link u can fwd me.
|
|
|
|
|
this code works fine for me:
this.comboBox1.DataSource = this.dataGridWrapper1.table;
this.comboBox1.ValueMember = "ID";
this.comboBox1.DisplayMember = "DT";
:
:
:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) {
string s = this.comboBox1.SelectedValue.ToString();
}
I get the id corresponding to the selected dt
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
thanks a lot.
I had set the sort property of combobox= true,
this is creating trouble.
But, why its creating the error. Any clue?
But still there is another problem,
When the query is giving error, it stops at fill method of DAdapter,
The exception is "Datatype mismatch in criteria expression"
I cheked the DB datatype, both are same in both column.
Do you know the reason.
|
|
|
|
|
show the concatenated string
like
"select * from table where cid ='" + comboBox.SelecteValue.ToString() + "'";
|
|
|
|
|
|
So what happens when I visit your site from the UK and my language is set to "en-gb"? I can understand "en-us" but you won't display anything to me.
Also, your database is not normalised. What happens if you want to add a new language in the future? This article might help: Normalising the data model[^]
pyde wrote: Have somebody any tips? I don´t get it to work.......
Since you don't say how it doesn't work we can't actually give you any specific help. HOW does it not work? WHAT does it do that it should not? WHAT doesn't it do that it should?
|
|
|
|
|
the idea is when the user are in the default.aspx he or she can from an calendar choose some events which are disposed in the calender and it's information is poped up in a panel where you can se the different language for events.....
So I select a day from the calendar which are underlined and the panel is not show the information...
this code I'h in the masterpage.cs to for the calendar
protected void calEvents_DayRender(object sender, DayRenderEventArgs e)
{
DataSet ds = CacheUtility.GetEvents(Cache);
DataView dvEvents = new DataView(ds.Tables[0]);
string strFilter = String.Format("eventDate >= '{0}' AND eventDate < '{1}'", e.Day.Date.ToString("yyyy-MM-dd"), e.Day.Date.AddDays(1).ToString("yyyy-MM-dd"));
dvEvents.RowFilter = strFilter;
e.Cell.VerticalAlign = VerticalAlign.Top;
if (dvEvents.Count > 0)
{
e.Cell.Controls.Add(new LiteralControl("<p>exhb</p>"));
e.Cell.BorderColor = System.Drawing.Color.Black;
e.Cell.BorderWidth = 1;
e.Cell.BorderStyle = BorderStyle.Solid;
e.Cell.BackColor = System.Drawing.Color.Yellow;
}
}
/max
|
|
|
|
|
Hi, I am facing a problem in GDI+ drawing , I have drawn a rectangle on the panel and rotated to some angle. Anyone can guide me how can I apply mouse hittest on the rotated rectangle. I will be thankful to you. I am using following code to draw and rotate the rectangle.
<br />
Matrix mx = new Matrix();<br />
mx.RotateAt(30, new PointF(70, 70), MatrixOrder.Prepend);<br />
e.Graphics.Transform = mx;<br />
g = e.Graphics;<br />
Rectangle rect = new Rectangle (10,10,100,100);<br />
Regards,
|
|
|
|
|
abstract class is base class.why we declare in abs class.
and we implement in child class. directly we can implement in
child class.what reason?....
|
|
|
|
|
polymorphism
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
Because any class that derives from your abstract class is now forced to implement any abstract methods you may have there.
newman wrote: directly we can implement in
child class.what reason?....
You could extend that argument to all base classes - maybe you should buy a book on OOP?
|
|
|
|
|
Vikram A Punathambekar wrote: You could extend that argument to all base classes - maybe you should buy a book on OOP?
And get familiar with the concept called inheritance... pretty much powerfull... may save you a lot of work
|
|
|
|
|
Hi,
I am asked to do an user control which takes the input for the PageSize
and PageNumber.The User control also has a button on clicking which would set the PageSize and Page Number of a Grid.Grid is not part of a user control.
If a Page has a Grid control and my user control is registered in it.
How should I be doing this?I need an approach.Do I need to raise an event
from user control which will be captured by the page containg grid.
So that I can do databinding in that by assigning the values of pageSize and Page Index from User Control.
Any suggestions or links would be helpful.
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
I've been having some trouble with the webbrowser component.
I can only make it work with an combobox rather than an textbox.
When i input an address into the textbox it loads few seconds than crashes the programe.
With an combo box i need to pre-input webpages then it works,
i could use some help on how to replace the combobox with an textbox.
Thanks in advance
Ben
|
|
|
|
|
It would be impossible to judge the error without viewing ur code....
|
|
|
|
|
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
comboBox1.SelectedIndex = 0;<br />
webBrowser1.GoHome();<br />
}<br />
this would initialize the combobox way where i can input populate the combobox with serveral pages i like.
when i try with the textbox:
<br />
private void btnEnter_Click(object sender, EventArgs e)<br />
{<br />
wb1.Navigate(new Uri(txtbox1.TextChanged.ToString()));<br />
}<br />
'The solution is proply easy tough i'm just an beginner
|
|
|
|
|
i have used the Image Processing Lab tool which was created by Andrew Kirillov...
I have one doubt.. how can use colorfiltering.cs file as a main one(separate project's main file).
but i should watch the changes in image in preview window while clicking tha redslider or blue slider or green slider which is in
colorfiltering form design..
|
|
|
|
|
How do I wake a sleeping thread when Thread.Resume is obsolete?
Som
|
|
|
|
|
Make the thread call Monitor.Wait() on a lock variable, then have the waking logic call Monitor.Pulse() on the same lock variable.
MSDN documentation: http://msdn2.microsoft.com/en-us/library/system.threading.monitor.aspx[^]
Example:
<br />
class Threaded<br />
{<br />
private object myLock = new object();<br />
<br />
private void GoToSleep()<br />
{<br />
lock(myLock)<br />
{<br />
Monitor.Wait(myLock);<br />
}<br />
}<br />
<br />
public void WakeUp()<br />
{<br />
lock(myLock)<br />
{<br />
Monitor.Pulse(myLock);<br />
}<br />
}<br />
}<br />
|
|
|
|