|
I think your problem is here
SqlConnection conn = new SqlConnection(ConnString);
SqlDataAdapter da = new SqlDataAdapter(query, ConnString);
I think it should be
SqlConnection conn = new SqlConnection(ConnString);
conn.open;
SqlDataAdapter da = new SqlDataAdapter(query, conn);
|
|
|
|
|
A mistake that should not have been made. But still the problem is not resolved.
|
|
|
|
|
overloaded Name wrote: but does not show data either.
That is rather indefinite.
I am guessing that you mean that it doesn't show anything at all.
The reason I think that is that I googled for examples.
And one of the shows the use of the 'Visible' property which is a property of the parent of that class. The description of that suggests that it must be true for display to occur.
|
|
|
|
|
Hey everybody.
I have a very small trouble...
List view double click event is getting invoked if I am doing double click on its scroll bar.
How to avoid this...
Thanks in advance..
--
CHEERS
|
|
|
|
|
what are the features of row docking. is it something like data rows on top and stay on their fixed positions. If so how we can use it.
|
|
|
|
|
Is this a feature that the user has asked for? If so, why not ask them what they mean by this? It could mean 2 or 3 things, so it's best to find out out what your users think as it's them you should be satisfying.
|
|
|
|
|
Yes, Hanlon is right, you have to ask them "what they mean by this? It's best to find out out what your users think as it's them you should be satisfying."
In the mean time if you want to know what row docking means. I'll give you an overview about it. Row docking is accessible via Row.Dock property and we can specify multiple docked rows. If our data grid already has docked rows, the next docked row will be placed after the previously docked row and before the first non-docked row. Docked rows can also be filtered or grouped as any other data rows.
To get in depth go here about row docking
Hope it will help you.
|
|
|
|
|
Hello everyone,
I am working on a project where I have to automate the process of entering data through a website. I decided to use the WebBrowser control in .NET for this task.
The problem I am having is that when I try to click on certain buttons, nothing happens. After lookign at the HTML code, I saw a pattern. I can click on buttons where the input type is submit, but I have trouble with the buttons where input type is button and they only have an onclick attribute with javascript code.
I have also tried to use the InvokeScript() method, but that also does not work.
The only think I can think of is that JavaScript is disabled for the WebBrowser control.
Can anyone give me any ideas on how I might be able to resolve this issue?
|
|
|
|
|
The WebBrowser Control uses the same code Internet Explorer does, and also its current settings. So if someone fiddles with IE, your WebBrowser will suddenly behave differently, and you might not like that. I am not aware of an actual solution to this, other than looking for another Control, which probably will cost you.
|
|
|
|
|
|
I always found that the webbrowser control only allows a subset of javascript. Don't have proof for that though and I always found another way of getting things done. A normal onclick should fire though, are you sure there is no error (mistyped a capital or something?
V.
|
|
|
|
|
The WebBrowser control does not have a life of it's own. It's just a wrapper around the Trident layount engine that IE uses. So it should support all of the JavaScript that IE supports. However, it is very quirky to use the control to do everything that a developer would expect to be able to do with it.
|
|
|
|
|
The textbox looses its value on the text changed event. I have set the autopostback event to true on this textbox and when I change its current value and move to next field, it restores back the current value and does not maintain the changed value.
IS there any other setting I could set, so the text box does not loose the changed value?
<asp:TextBox ID="txtSalary" size="10" runat="server" OnLoad="showMinSal" OnTextChanged="CompareSalary" AutoPostBack="true"></asp:TextBox>
modified on Tuesday, August 2, 2011 2:43 PM
|
|
|
|
|
I'm going to guess that your OnLoad is clobbering the change you just made. Try putting this line at the beginning of "showMinSal" and see what happens...
if (Page.IsPostBack) return;
|
|
|
|
|
Right on dot! Thanks for your help...the initial page reads values from database. and on the autopost, it would populate the value from database again!
you guys are awesome!
|
|
|
|
|
I've run into that problem before, so it looked familiar. Glad to help.
Experience is what you get when you didn't get what you wanted. - Randy Pausch
|
|
|
|
|
Hi All,
I have a method that returns List<T>, T can be a number of types but based on the type I want set different properties.
I can detect the type passed into the method and can switch on the name but I'm a bit lost on how to convert my List<type> to list<T> so the return type is correct.
the error is Cannot implicitly convert type List<type> to List<T> which is understandable but how do I return List<type> as List<T> where T is type?
|
|
|
|
|
Well, type (in your example), must be derived from type T, so the easiest way to tell it to do this would be to put a constraint on T in your declaration, e.g.
public List<T> MyMethod<T>(Type type) where T : MyBaseType
{
}
|
|
|
|
|
Thanks Pete,
I've tried putting constraints on the method but I'm still getting the error, I think I'm doing something fundamentally wrong.
perhaps an example would help
public List<T> getall<T>()where T : employee
{
type t = typeof(T)
switch (t.name)
{
case "manager":
List<manager> all = this.GetManagers()
break;
default
List<sales> all = this.getSales()
}
return all
}
This is something along the lines of what I'm trying to do (I haven't tried compiling it but it's the types I have the issue with, not syntax)- Imagine both Sales and managers are of type employee but managers are paid monthly and do not get commission but sales are paid weekly and do get commission, so whilst they have much in common I want to treat them differently.
Hope this makes more sense.
|
|
|
|
|
You're starting to get there, but you need to cast to the appropriate list type as in:
public List<T> GetAll<T>() where T : Employee
{
List<T> all = new List<T>();
if (typeof(T) == typeof(Manager))
all = GetManagers() as List<T>;
else
all = GetSales() as List<T>;
return all;
}
|
|
|
|
|
Ah yes, got it!
Thank you very much I didn't think of casting the whole list.
Much appreciated.
Paul
|
|
|
|
|
No problems. Glad to be of service.
|
|
|
|
|
I'm curious what are you trying to achieve with a method like this. Since you are forced to specify an exact type at the point of call anyway, for example,
var managers = getall<manager>(); you might as well call a method with a different name, like this:
var managers = getAllManagers(); In other words, your getall method hides certain details, yet the caller is forced to reveal these details back! Could you please explain your intent?
|
|
|
|
|
I agree. It seems like the problem here is showing up the underlying inconsistency in what the OP is trying to do. I don't see the purpose of this method.
|
|
|
|
|
I'm sure there are a number of ways to do it, this is the scenario I have been presented with.
I have some big text files and depending on their origin will contain slightly differing sets of data.
I have regex patterns that will return a collection of matches - each match describes an object of type T, Once I have the matches I know what type T is and can process the list on this basis. 90% of the processing is the same but differs slightly based on T.
Hope that makes some sense.
|
|
|
|