all groups > c# > june 2006 > threads for thursday june 29
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Stored procedure
Posted by Alan T at 6/29/2006 10:41:48 PM
Is there a sample code I can use to call a stored procedure which has input
and output paramerts ?
... more >>
Tabcontrol Colors
Posted by Robert Bravery at 6/29/2006 10:06:33 PM
Hi all,
I dropped a tabcontrol on my form. The forms background color is a pastel
blue. I can get the tabpage to thesame pastel blue. Bt cannot get the tab nd
tab border to the same color. it remains on the normal windows grey
any help
Thanks
Robert
... more >>
IEnumerable is strange
Posted by Tin Gherdanarra at 6/29/2006 9:05:00 PM
Dear mpdls,
here is a simple example of an IEnumerable that
generates integers:
It works, but I have only a vague idea of what's
going on. I understand that /yield/ wraps the
humble integer that comes from
counter++
into an IEnumerator<int>.
I don't understand why I have to implem... more >>
ASP.Net 2.0 CheckBox List Layout Issue?
Posted by Chaprasi at 6/29/2006 8:52:23 PM
Gurus of asp.net and C# Please Help!
I have a checkbox list solution to implement. This is my code
<asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatColumns="3"
RepeatDirection="Vertical" RepeatLayout="table">
<asp:ListItem>Item 1</asp:ListItem>
<asp:ListItem>Item 2</asp... more >>
Equality and generics
Posted by Giulio Petrucci at 6/29/2006 7:47:47 PM
Hi everybody,
I'm implementing a sort of my own generic collection.
It has a method that returns an int representing the index for a particular
index. If I try to compile the code below:
class MyCollection<T> : ICollection<T> {
T[] array;
MyCollection() {
array = new T[];
}
int Get... more >>
creating a type from a string
Posted by Dan Holmes at 6/29/2006 6:23:01 PM
If i have this value in a string "System.Int32", how can i get that into
a variable with the type of Type?
string s = "System.Int32";
Type t = //do something here
so that t.ToString() == s is true
dan... more >>
Knowing an object implements an Interface
Posted by Ron M. Newman at 6/29/2006 6:05:04 PM
Hi,
Is there a quick way to know if a given object implements IComparable?
(without casting or anything like that). Something that uses reflection?
Thanks
-Ron
... more >>
How to get SP params?
Posted by Brett Romero at 6/29/2006 5:27:18 PM
How do I get the names of parameters for a specific stored procedure.
I just need a listing of the names and nothing else.
Thanks,
Brett
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
animation in .net
Posted by Prashant M at 6/29/2006 4:58:57 PM
can anybody suggest me how to create a PAGE TURNING EFFECT IN .NET using C#
... more >>
error creating timer_elapsed handler.
Posted by hazz at 6/29/2006 4:25:38 PM
Why do I get this error for this simple console app. It is complaining about
the 'timer1_Elapsed' argument in
System.Timers.ElapsedEventHandler(timer1_Elapsed);
An object reference is required for the nonstatic field, method, or property
'TestTimerIntervalFromConfig.Class1.timer1_Elapsed(ob... more >>
Down-casting of Typed Collection (Casting Generic Types?)
Posted by conchur at 6/29/2006 3:44:32 PM
Is there an elegant way to have a class utilise an inherited method to
return a Typed Collection of itself?
Example:
class MyList<T> : List<T> where T : MyRoot
{
Add...
Remove...
}
abstract class MyRoot
{
public static MyList<MyRoot> List(...)
{
// return MyList<M... more >>
REPEATER PROBLEM
Posted by Savas Ates at 6/29/2006 2:46:47 PM
It shows nothing . No error and nothing on the screen.There is no error too.
Im sure sql query is returns some rows i tried it Sql query analyser ? what
is the problem ?
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem,"urunadi")... more >>
IOException File used by another process
Posted by George at 6/29/2006 2:27:03 PM
Hi,
I am re-writing part of my application using C#. This application starts
another process which execute a "legacy" program. This legacy program writes
to a log file and before it ends, it writes a specific string to the log file.
My original program (MKS Toolkit shell program) which k... more >>
DataRow and Item
Posted by Vik at 6/29/2006 2:09:17 PM
I used to work in VB.NET. Now in C#, I have:
using System;
using System.Data;
using System.Data.SqlClient;
DataRow dr;
Then I want to use dr("ColName") but there is no Item property in the
IntelliSense. What is wrong here?
Thanks.
... more >>
Generics
Posted by Robert at 6/29/2006 2:08:39 PM
Hi,
I have a generic List that holds a type that must inheret from a base
type and implement a interface.
Can I use the generic list without nowing the derived type?
Here is some code to explain the situation (i hope):
namespace Nevermind
{
public abstract class BaseCar
{
... more >>
DateTime question year, month, day from 38896
Posted by Jim Stools at 6/29/2006 1:57:42 PM
Any idea how to find the year, month and day from (Int32) 38896? 38896
presents 6/28/2006 in excel. The dates in the database are (all) stored as
Int32's corresponding to the way dates are handled in excel excluding time.
Thanks In Advance
... more >>
Database Metadata // OleDB
Posted by sloan at 6/29/2006 1:53:04 PM
Back in ADO days, it was fairly easy to get the meta data (tablenames,
columnnames , etc) .. with all that schema stuff.
I have a Access database, that I'd like to get the list of tableNames in it.
How does one get the metadata about a database thru DotNet?
Thanks.
... more >>
Duplicate rows in datagrid!
Posted by DBC User at 6/29/2006 1:33:13 PM
I have two datasource combained to form a datagrid. I am merging the 2
dataset to a new dataset to display them in a datagrid. Is there an
option remove duplicates during merging??
Thanks.
... more >>
Can I use different data sources for each row in a given column (column type dropdownlist)
Posted by zaki.agha NO[at]SPAM gmail.com at 6/29/2006 1:31:34 PM
Hi
I have a aspx application written in c#.
I have created a datagrid control on the page.
One of the columns in the control is a dropdownlist.
I would like to set the data source of the dropdownlist to a different
recordset for each row.
How can I do this in C#?
I have used the ItemDataBou... more >>
Auto-size Listview
Posted by Mantorok at 6/29/2006 12:29:20 PM
Hi all
I have a listview, after I've added all of the items in the listview I want
to set the height so that all items can be viewed at once.
Can this be done, if so, how?
Thanks
Kev
... more >>
Try/Catch problem
Posted by bad_boyu at 6/29/2006 12:15:58 PM
Hello,
I have the following code:
try
{
Salarii.Editors.AngajatiNewFrm _angNewFrm = new
Salarii.Editors.AngajatiNewFrm();
_angNewFrm.Connection = this.Connection;
_angNewFrm.ShowInTaskbar = false;
_angNewFrm.ShowDialog();
_angNewFrm.Dispose();
}
catch ( Exception ex )
{
Salari... more >>
Combo box "specified cast is not valid" error
Posted by Jayyde at 6/29/2006 10:30:53 AM
Not sure why all of a sudden this line of code:
cmbProductCategoryTreeDisplayName.SelectedIndex = 0;
is producing a "Specified cast is not valid error". In the watch it has 1
item in it at index 0. This code hasn't been changed in months and it has
never had this problem before...
Tha... more >>
Hashtable - array as value
Posted by mj.clift NO[at]SPAM virgin.net at 6/29/2006 10:25:33 AM
Hi All,
Is it possible to have the value of a hashtable key set as an array.
Then look up the value for that key and have it return a random value
from that array?
Thanks,
Calvin
... more >>
DataGridView (hidden info per row)
Posted by Jake Forson at 6/29/2006 10:14:22 AM
Hi there. Is there a standard technique for storing additional info per row
in a "DataGridView" (say, a hidden key per row for instance). I assume it's
just a matter of creating a hidden column to store this info but I just want
to make sure there isn't a more conventional way. Thanks very muc... more >>
using params with out.
Posted by Ashish at 6/29/2006 10:01:53 AM
hi All,
Iam facing a peculiar problem, where i would like to parse the passed
parameters and would like to figure out which ones are marked 'out'. For
example the method signature is
public DataSet SearchItems(string procname, params objects[] values)
{
// call database here
}
and c... more >>
Datatable search
Posted by arun.hallan NO[at]SPAM gmail.com at 6/29/2006 9:52:41 AM
I have a datatable with different id's in it. Each id has a set of
attribute pairs.
EG
id - attribute name - attribute value
========================
dog -legs - 4
dog - barks - true
cat - legs - 4
cat - barks - false
I simple want to query the table, like in sql, and select an attr... more >>
How to declare properties across inherited interfaces.
Posted by DaTurk at 6/29/2006 9:31:07 AM
Is it possible to have a property defined in one interface, with just
the get portioned stubbed out, and then in an interface inheriting from
that interface declare the set portion of the inherited stubbed out
property? So that only classes implementing the second interface can
set properties?
... more >>
Default value of an enum
Posted by veerleverbr NO[at]SPAM hotmail.com at 6/29/2006 9:09:47 AM
Suppose having define an enum like this:
public enum SomeEnum
{
[DefaultValue("1")]
Something,
[DefaultValue("2")]
SomethingElse
}
Having a variable of the type ETransactionOwnerType, say:
SomeEnum test = SomeEnum.SomethingElse;
How can get this variable's default value... more >>
Changing row height in a data grid without changing font size
Posted by Kasey at 6/29/2006 9:06:02 AM
How do you change the row height in a data grid - I do not want to increase
the height by changing my font size. My product is a touch screen so I have
to make the row height large enought for a finger press.... more >>
'As' and 'is' for value types
Posted by Edward Diener at 6/29/2006 9:03:23 AM
I find it amusing in VS2003 .NET C# that I can use 'is' with a reference
type to see if it is actually a value type but I can not use 'as' to see
if a reference type is actually a value type. Is there a reason in the
language for this anomaly ?... more >>
Problem with windows service.
Posted by Niron kag at 6/29/2006 8:46:02 AM
Hi,
I built a windows service and I added it references to COM objects which I
use in my code.
The service work well when I install it in my pc (windows 2000).
When I install the project in other pc (Server – windows server 2003) it
returns me an error:
“Service on local computer starte... more >>
threading and UI calls
Posted by Jim H at 6/29/2006 8:41:02 AM
About a year back I posted a question and eventually implemented the
following code in an event handler as a result:
object[] some_args = new object[1];
some_args[0] = my_event_args.results;
ISynchronizeInvoke lSync = this as ISynchronizeInvoke;
if(lSync == null)
{// UI Thread
UIDelega... more >>
Multiple Inheritance w/ Managed C++, how can you access an implementing classes properties after casting it to the base interface?
Posted by DaTurk at 6/29/2006 8:35:22 AM
I have three interfaces, lets call them General, Client, Server.
public interface General
{
public Value{get;}
}
public interface Client : General
{}
public interface Server: General
{
public Value{set;}
}
public class Something : Server, CLient{
}
public class ... more >>
littleEndian/bigEndian
Posted by docschnipp at 6/29/2006 7:13:01 AM
Hi,
as someone pulling to C# over from C++ I stumbled over something today for
which I was not able to find an answer:
HOW do I convert a byte block with a given endianess to an int32 and vice
versa?
In C++ I have this:
#pragma intrinsic(_byteswap_ushort)
#pragma intrinsic(_byteswap... more >>
Having issues reading App.config file
Posted by SAL at 6/29/2006 7:02:02 AM
Below is similar code that I am have and the line "myDataConnect mydata = new
myDataConnect(ConfigurationSettings.AppSettings["connectSQL"]);" is what I am
having trouble with.
The syntax is correct and I get no errors, but it is not finding the Key
“connectSQL†or any key for that ma... more >>
Dropdownlist with multiple data values?
Posted by keniget NO[at]SPAM gmail.com at 6/29/2006 6:36:27 AM
Hope I'm posting this in the right place.
Has anyone encountered the need to have more than one datavaluefield?
At present, I'm returning two columns, a StateID and a StateDesc and
they are being put into the datavaluefield and datatextfield
respectively.
I could REALLY do with binding an... more >>
How to 'lock' a file?
Posted by nvx at 6/29/2006 6:16:33 AM
Hi,
I have an application working with an Access database and I need to
'lock' the currently opened DB file in order to prevent it to be
deleted, modified by other applications etc. Does anyone know how to
achieve this? An information regarding unlocking a file would also be
appreciated.
Tha... more >>
How to stop on first error
Posted by dfetrow410 NO[at]SPAM hotmail.com at 6/29/2006 5:59:08 AM
Is there a setting in VS to stop the debugging prosess when is finds a
compile error?
... more >>
Master Page problem
Posted by Code Monkey at 6/29/2006 5:54:30 AM
Is it possible to update a section on a masterpage from a method on a
content page?
Ie; suppose I've got an area on a masterpage which is essentially a
shopping cart which is displayed on everypage (assuming it has items in
it). On an order summary page, I adjust the quantity of certain items.... more >>
COM+ and displaying call times on Form or Webpage
Posted by Joneseyboy at 6/29/2006 4:38:01 AM
Hi,
Apologies if this is in the wrong place but thought it would be a good place
to start.
Is there a way of reading a thread call time from COM+ and displaying the
thread time either in a C# Form or on a WebApp (ASPX Page)?
I know a little about vb/c# etc... but I've never touched on a... more >>
Variant problem with COM,C# ---help me
Posted by srinivas at 6/29/2006 3:52:28 AM
Hi ,
Pls help me to solve this problem .
/* --this is one of the function in COM component */
System.int32 ProjectLIsts(LPCTSTR prj , VARIANT* prj_list)
{
prj_Lists= { ARRY OF STRUCTES . ,.ONE STRUCTE FOR EACH PROJECT }
returns TOTAL NUM of PROJECTS
}
???.
If I add this COM comp... more >>
problem related to overloading == operator
Posted by Constantine at 6/29/2006 3:37:21 AM
Hi, I have developed one class called CProductInfo providing == and !=
operator features. I have one problem.
When I use this class in my program, say
CProductInfo product = null;
and later, when i check for emptiness,
if (product==null)
it returns false as if the product instance is... more >>
Diaplsy long message
Posted by Wilson at 6/29/2006 3:10:02 AM
Hi,
How can I display a long message in a web form ?
like : when we log in, the right hand pannel display message.
Welcome back, Wilson. If you're not Wilson, sign out by clicking the Sign
Out button above, and then sign in again.
Thanks
Wilson... more >>
Cannot put delegate in interface - why not?
Posted by atwomey NO[at]SPAM yahoo.com at 6/29/2006 3:08:34 AM
When I try and place a delegate in an interface, like this :
public interface ITest {
double foo();
delegate void bar();
}
I get an error "delegates cannot declare types". What is it about a
delegate that makes it incompatible in an interface. I know that an
interface cann... more >>
Reuse DEFINE and Const from C++ in C#
Posted by MilanB at 6/29/2006 2:26:01 AM
I have defined lot of constants in C++ header file, like DEFINE or const. I
used then within ActiveX controls.
Is there possibility to give C# direction to use those values from c++
header file, or I have to redefine all of them within C# units?
Thanks
Milan... more >>
hashtable storage
Posted by Lamis at 6/29/2006 2:00:03 AM
Hi,
I have a hashtabel m_haschtbl = new Hashtable();
I need to get out my objects from my hashtable in the same order like they
were stored. the order is very important..
I have used IDictionaryEnumerator en = m_hasctbl.GetEnumerator();
while (en.MoveNext())
{
m_object = en.value;
... more >>
Calling SQL from code has different behaviour than calling it from MS SQL Server Management Studio
Posted by jeeji at 6/29/2006 1:16:23 AM
HI
I am experiencing something funny here where I have two equivalent
queries: If I run them through query analyzer, the first runs slower
than the second, but if run through C# application, the first runs
faster than the second.
I have the following two equivalent versions of a query which... more >>
timer click button every X time
Posted by Avi G at 6/29/2006 12:42:02 AM
Hi,
how i can set that the timer will press the button every X time
automatically on my form with VS 2005, what is the code for that?
Thanks... more >>
Ping vs. SocketException
Posted by schaf at 6/29/2006 12:31:09 AM
hi NG !
My app knows the IP address of a remote computer from App.exe.config.
What's the best way to check if this pc in on the network ?
Ping ?
or Dns.GetHostByAddress(sRemoteHostDefinition).HostName and catch the
exception ?
Thanks
... more >>
how to produce library documentation?
Posted by Lloyd Dupont at 6/29/2006 12:23:11 AM
I'm trying to write the documentation of my library using XML tags.
I'm using NDoc but it doesn't support C# 2.0 very well.
Any tip on what other product I could use?
... more >>
TreeView DrawNode problem
Posted by John at 6/29/2006 12:00:00 AM
I have overridden the default DrawNode (OwnerDrawText mode) to allow me to
draw an extra icon at the front of the text block, while still using the
built-in icon list for another icon. The problem I am having is that when a
node is selected it snips the text to the length of the text minus t... more >>
Architectural issue (Singleton?)
Posted by Giulio Petrucci at 6/29/2006 12:00:00 AM
Hi everybody,
I have class library used by an application to log it's activity. This
application has got several Plug-Ins, and all these Plug-Ins use the same
library to log their activity. As the application logs everything on the
same log file for each day, I implemented a LogManager that... more >>
Update table record
Posted by Alan at 6/29/2006 12:00:00 AM
I want to update an employee's name, here's my code:
public void Save(int aEmployeeID, string aFirstame, string aLastname)
{
SqlDataAdapter DaEmployee;
DataSet DsEmployee;
// _Conn is instantiated in constructor
DaEmployee = new SqlDataAdapter("UPDATE employee " +
... more >>
Call DLL from a Windows form
Posted by Alan at 6/29/2006 12:00:00 AM
I have created a class library say, EmployeeDataDLL.dll. This is a data
access to the backend database.
How do I create an object of the class inside this dll from a Windows form ?
... more >>
Change solution location
Posted by Alan at 6/29/2006 12:00:00 AM
I have a ClassLibrary/Solution named as AClassLibrary, ie AClassLibrary.dll.
I want to change to the name of the solution/DLL to reflect the reality like
AClassLibraryDLL.dll.
How do I change the solution name and save the whole lot into a new location
?
... more >>
Datatype
Posted by Alan at 6/29/2006 12:00:00 AM
Is there any difference in these:
private string string1;
private String string2:
I found the colors of the 'string' and 'String' are different.
... more >>
|