 |
 |
Index ‹ DotNet ‹ Visual C#.Net
|
- Previous
- 1
- Dotnet >> Crytsal Reports LinesI var a report which is designed to represent a form. The detail rows need
to be seperated by lines. I am recieving mmy data accirately from a SQL
database. The report works fine; however whjen I place the line underneath
the row of fields the fields appear to be blank or covered up. in other
words all or parts of the data seem to disappear. Any ideas???
Thanks
Rick
- 2
- Visual C#.Net >> Calling a parent class methodI have a class (sharedClass) that is instantiated (not derived) by two other
classes (guiClassA and guiClassB). The sharedClass needs to be able to call
a method that is defined in its parent class (guiClass).
Specifically, when guiClassA or guiClassB calls a method from the
sharedClass, the sharedClass needs to log its actions by sending strings to
the guiClass (via guiClass method calls), which in turn display or record
this log information in their own unique ways.
How can the sharedClass call out a function from its parent class without
knowing exactly what kind of class the parent class is? (I can however
guarantee that the parent class will implement the logging function).
Since both guiClasses are not used in the same application, I was able to
solve this in C++ by declaring the logging function prototype in a header
file that was included by all the classes, and then defining the function
implementation at the same level as the guiClass was instantiated. Thus, the
connection was made by the linker. Is there any way to do something similar
in C#?
- 3
- Visual C#.Net >> How to make SoapHttpClientProtocol create different TCP connection for web service invocation?I use VS auto generated code to invoke a internal network webservice.
The auto-generated code use class SoapHttpClientProtocol to do Soap-on-
http communication. It turns out that for single
SoapHttpClientProtocol instances, TCP connection is always maintained
for reuse. This is understandable. Now, I have one load balancer
between client and backend webservice cluster, so, single TCP
connection for single invocation is prefer-ed.
How to make it create TCP connection for one method invocation and
then close it?
Thanks,
- 4
- Winforms >> Question on ClickOnce DeploymentI have an app which I deployed last week. If I make a change to the app and
it only affects changes to existing code. what I mean by that no new
projects/dlls, no new controls etc. What do I need to copy up to the
deployement site, just the new .exe?
Bill
- 5
- Net Framework >> Re: Question on ConfigurationElementCollection designA while back, a question was posted on ConfigurationElementCollection design as follows:
"I have 2 questions on using element collections when building a custom
section handler. I'm using the "declarative" model and I can post the code
if necessary.
My code works and the XML in app.config for my custom section looks like this:
MySection name="x"
Stores add name="store1"
add name="store2"
Stores
MySection
But I have 2 sort of "cosmetic" questions about changing the XML:
1.
...
2. In some cases it might also be nicer to skip the outermost "Stores"
element and just have this:
MySection name="x"
Store name="store1" Store name="store2"
MySection
But I don't see how to arrange for this in the declarations of a
ConfigurationElementCollection. It seems to require the outermost element to
key on its name. What I want is sort of an "unnamed" collection of Stores."
The first part of the question was answered by using the ConfigurationCollection attribute.
Did you ever get a solution to the "unnamed" part (part 2) of your question? I'd like to also add a section collection to my config section and adding a name is redundant. ie., the "Stores" element in you sample. Can an "unnamed" section be added?
- 6
- Winforms >> how to: persist the DesktopBounds with a menu?hi all
i have a form that i would like to persist its desktopbounds.
however, upon each shut down + start up of the application
and the form,
the form's bottom grows by about the size of a menu.
this is obviousely an unwanted effect.
how can i persist the desktop bounds of my form with the menu?
assaf
- 7
- 8
- Visual C#.Net >> Remote Desktop Connection from c#Hi,
Is there a way to launch an remote desktop connection to a specified
server/username from c#?
If there's a way to send the password too that would be useful, but i'm
not so interested in that if its a problem.
Thanks!
Andrew
- 9
- Dotnet >> PropertyGrid and datatablehi
here is my question
I use a propertyGrid to display/modify values
some of my properties are in database...for exemple : a list of city
(city_id, city_text)
is it possible to give a datatable to the property and let it display in a
combobox the list of the city?
I want to display le name of the city (city_text) and want to retrieve the
id (city_id)...
in other words, is there a way to use displayMember & valueMember &
datasource in the propertyGrid????
thanks in advance
bye
lobrys
- 10
- ADO >> Progress bar doesn't incrementI created a windows form that has a progress bar on it. I am running a bunch of statements to update data on the database. I want the progress bar to increment (perform one step) after each update. The problem is that the progress bar doesn't move (it just sits there until the end) can anyone give me an example of how to accomplish this?
example:
progressBar1.Visible=true;
progressBar1.Show();
progressBar1.Maximum = 24;
progressBar1.Step = 1;
progressBar1.PerformStep();
Perform_update1;
progressBar1.PerformStep();
Perform_update2;
progressBar1.PerformStep();
Perform_update3;
etc.
thanks in advance
-Jeff-
- 11
- 12
- 13
- Visual C#.Net >> Alternative to 'abstract' in base forms?I'm creating several forms that inherit from a base form. I want to require
the derived forms to implement certain methods of the base form. The easy
solution would be to declare abstract methods in the base form. But I can't
do that, since the WinForms Designer can't instantiate an abstract form.
So, what would be a good alternative to using abstract methods. I'm thinking
about declaring an interface, but that seems kind of klunky. Thanks.
--
Dave Veeneman
Foresight Systems
- 14
- Microsoft Project >> Material Cost Input and CalculationOur Material Cost View is not acting consistently and am wondering if anyone
knows what the reason and/or fix might be.
In some instances it is working as desired where once the material resource
is assigned to a task you must enter the units into Actual Work then Actual
Cost is calculated. Entering directly into Actual Cost is blocked.
In other instances it will block from allowing input into Actual Cost on the
first input column then will allow it after that. If data is input into the
Actual Cost field Actual Work is not calculated and the 2 become out of sync.
In even other instances it allows input into Actual Cost on the first try.
The problem does not seem to be project specific either. Sometimes it works
OK on a project and other times it doesn't. I have not been able to identify
any commonality in occurance.
Thanks,
Debbie
--
Debbie P
- 15
- Microsoft Project >> Resource across projectsI'm getting there - thanks to this forum!
I now have a shared resource across 3 projects (one of which is absence,
i.e. sickness & holidays!)
If I open my resource file (in resource usage view), I can see by person,
all the work that they have done across the projects in a week (to make sure
it adds up to 35 hours) then by project I can see the progression - LOVELY
But, of course, a problem remains (!), since I receive worksheets (across
the projects) by man, I would like to be able to enter the hours worked from
the resource usage view in the shared resource file, and then have that
update the hours worked in all the projects (and consequently hours remaining
etc etc) - I don't seem to be able to do this (it doesn't have any effect,
and will not save), I have to go into each project & update them individually
(which then updates the shared resource file)
I'm sure there must be a way of doing this, all help appreciated
Thanks
--
Helen
|
| Author |
Message |
Rulandas

|
Posted: Mon Jan 30 02:40:54 CST 2006 |
Top |
Visual C#.Net >> byte[] to hex
What's the way to convert a byte[4] to a hexadecimal?
DotNet394
|
| |
|
| |
 |
Jon

|
Posted: Mon Jan 30 02:40:54 CST 2006 |
Top |
Visual C#.Net >> byte[] to hex
Water Cooler v2 wrote:
> What's the way to convert a byte[4] to a hexadecimal?
Do you mean to a hex string? Convert.ToString(byte[]) is the easiest
way, although it puts a hyphen between each byte which you may not
what.
Jon
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Visual C#.Net |
- Next
- 1
- Dotnet >> how to set listview's backgound image?i tried to set listview's background image
(using managed C++)
first try, i maked bitmap and set back ground image like below code
but, it had no effect
LiveView * listViewJobTable
...
HBITMAP hBitmap =
LoadBitmap(g_hInstance,MAKEINTRESOURCE(IDB_BITMAPJOBLIST));
listViewJobTable->BackgroundImage = Image::FromHbitmap(hBitmap);
second try, i used win32 API ... using ListView_SetBkImage macro like below
code
but it had no effect too
HBITMAP hBitmap =
LoadBitmap(g_hInstance,MAKEINTRESOURCE(IDB_BITMAPJOBLIST));
LVBKIMAGE lVBKImage;
lVBKImage.ulFlags = LVBKIF_STYLE_NORMAL;
lVBKImage.hbm = hBitmap;
lVBKImage.pszImage= NULL;
lVBKImage.cchImageMax = 0;
lVBKImage.xOffsetPercent = 100;
lVBKImage.yOffsetPercent = 100;
ListView_SetBkImage((HWND)listViewJobTable->Handle.ToInt32(),&lVBKImage);
How Can I set ListView's Back ground Image using managed C++?
- 2
- Winforms >> Adding handlers to events of a static variable in a classThe below code does not fire the event when I add a row
to the table on the form.
Is there an issue with static variable's events ?
If I attach and handler on the form, it works, but i dont
want to do it on every form, i want to do it in my class
with the static dataset in it..
Any suggestions?
---------
Public Class Test
Private Shared WithEvents _data As New dsCaptain
Public Shared ReadOnly Property Data() As dsCaptain
Get
Return _data
End Get
End Property
Private Shared Function loadCategory() As Integer
Return DataManager.adpCategory.Fill
(_data.Category)
End Function
Public Shared Function LoadCategories() As Integer
loadCategory()
AddHandler _data.Category.RowChanged, New
DataRowChangeEventHandler(AddressOf CategoriesChanged)
Return _data.cat_subCat.Count
End Function
Public Shared Sub CategoriesChanged(ByVal sender As
Object, ByVal e As System.Data.DataRowChangeEventArgs)
If e.Action = DataRowAction.Add Then
'MessageBox.Show("Category Added")
'make some calc, add a row to other tbl
'update database e.t.c.
End If
End Sub
End Class
-------
this class is called, int the form like:
---
Friend WithEvents SuperData As dsCaptain
Public Sub New()
MyBase.New()
InitializeComponent()
'------
SuperData = Business.Data
End Sub
Private Sub addRow_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles deleteRow.Click
mRow = SuperData.Category.NewRow
With mRow
.Name = "New Account"
.DateAdded = DateTime.Today
End With
SuperData.Category.AddCategoryRow(mRow)
End Sub
---
- 3
- 4
- Microsoft Project >> Fixed Duration and Work HoursQuestion on something I haven't been able to figure out and it happens
if the task is complete or in progress.
I have set the whole schedule to Fixed Duration but whenever I add or
delete a resource my start and finish dates change.
I thought with type set as Fixed Duration the dates shouldn't change
even if the overall work hours for the task did change.
I know Fixed Work will keep the work the same which should then keep
the date per se in check but I think Fixed Duration will do this job
better until I'm finished resource loading.
Any thoughts?
Cole
- 5
- Visual C#.Net >> PLS HELP! - Detect closing a UserControl before disposedHI,
I have a user control, say with one textBox.
I need the following: when the user closes form (either calling Form.Close, or pressing "X" or anyhow),
UserControl copies a file from a predefined folder to a folder in the textBox.
UserControl doesn't have a "Closing" event, so i tried to override UserControl.Dispose() :
// ==========================================================
protected override void Dispose( bool disposing )
{
// Here what i've added
File.Copy(SourceFile, TextFolder.Text + DestFile);
// If you check TextFolder.Text value, it's = "" for some reason...
// From here VS generated
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
// ==========================================================
The problem is that when i get to Dispose function, TextFolder.Text value is somehow blank.
I don't really understand why, as the UserControl is not disposed yet, but all controls located on the usercotrol,
lose values when get into Dispose.
Any ideas would be very, very, very appreciated!
Thank you,
Andrey
- 6
- Dotnet >> enumerate filesHi,
I wanted to list all files in a directory so I found some code:
Dim t(), st As String
t = System.IO.Directory.GetFiles(System.IO.Directory.GetCurrentDirectory,
"*.txt")
Dim en As System.Collections.IEnumerator
en = t.GetEnumerator
While en.MoveNext
st = CStr(en.Current)
ComBoFilel.Items.Add(st)
End While
To add just the name of the file rather than its whole path, do I need to do
some string manipulation to find the last "\" or is there a simpler method
Thanks
DV
- 7
- Visual C#.Net >> Seeking simple security exampleI am trying to create a couple of event and a memory mapped file for
interprocess communication that have security settings such that they can be
used between any two users. I have found some horribly complicated code on
the web and have got totally bogged down in scals and dacls. Can someone
point me at a nice simple example of how to set up security attributes for
unrestricted access?
--
Dave
- 8
- Visual C#.Net >> Multiple ClickOnce manifests (slightly OT)OK heres an oddity...
I am using a ClickOnce (online only) deployment model; I have various
servers (primarily for different environments: testing, production etc), and
I want to have a *similar* manifest on each, with the main difference being
the config file (so that each connects to appropriate servers). To get
around the hashing on the config file, I simply publish the app (via
MSBuild) several times with different app.config contents each time.
The problem:
* (assume empty app-cache)
* Hit .application on download-server "A" - this downloads the app and
starts talking to web-service server "a" (correctly based on web.config)
* Close app
* Hit .application on download-server "B" - this then *also* starts talking
to web-service server "a", even though the config file on "B" says "b"
Obviously the runtime is deciding that they are the same app, and re-using
the cached copy.
So - can I fix it?
Is there any way (preferably automated either via some bespoke C# or just
MSBuild command-line parameters) of telling it that the two should be
treated separately? Preferably while using the same code-signing
certificate?
Thanks in advance,
Marc
- 9
- 10
- 11
- Visual C#.Net >> display user please wait, while backend is processingGurus,
I have a mainpage.aspx webform, in the page load of this page I am
displaying a text "Please wait connecting..." and then I want the user
to see this output on the WebForm, while I do some backend processing.
Once the backend processing is done I want to redirect the user to
another page e.g. "http://www.google.com".
I want to achieve the above without javascript, it should be pure
ASP.Net, is this possible ?
Can I show the user some message in a WebForm, while I do some backend
processing?
I tried
Response.write("Please wait connecting...");
Response.flush(); // This works.
// Do some backend process
Response.Redirect("http://www.google.com"); // This generates the error
"Cannot redirect after HTTP headers have been sent."
What am I missing?
Help is appreciated
Thanks,
Shailendra Batham
- 12
- Visual C#.Net >> textbox og tal !!er der ikke en nem måde at få en textbox til kun at acceptere at der kun
bliver indtastet Tal 0-9 og som skal returnere en int værdi samtidig.
Textboxen skal bruges til et Pris Felt.. eller skal jeg lave min egen
validering af boxen og selv omformatere typen fra text til int .
ps. jeg bruger visual studio .net...
tak.
Tor Lund
- 13
- Visual C#.Net >> Continously Running ThreadDear:
I used to code a continously running thread in C++ like following:
Handle hStopEvent = CreateEvent(NULL,true,false,NULL);
UINT uOptional = 0;
_beginthreadex(NULL,0,wtInvestigate,(LPVOID)NULL,0,&uOptional);
unsigned _stdcall
wtInvestigate(LPVOID lpParams)
{
while(true)
{
DWORD dwThreadStatus = WaitForSingleObject(hStopEvent
,DELAY_TIME);
switch(dwThreadStatus)
{
case WAIT_OBJECT_0:
//TODO
break;
case WAIT_TIMEOUT:
//TODO
break
}
}
}
How can I achieve the same procedure in C#
- 14
- ADO >> improving executenonquery timesHi,
We are new to ADO.NET, and any help would be appreciated.
The scenario is as follows: we have a large number of objects
(thousands) to write to a database. Each object has a method that
returns the SQL query which will update a relevant table in the
database.
We had opened a connection to the databse, and for each such string
did executenonquery (on that one connection). The results were
horrible. Then we had moved on to aggregating all the queries,
separated by newline in a one huge string (with StringBuilder of
course) and doing only one executenonquery per all the objects - that
was a big improvement.
Is the paradigm of doing one large executenonquery instead many small
ones, for one connection is indeed optimal ?
Is the paradigm of having one connection (instead of say, thousands,
each per object) optimal ?
Do you have any idea how the times may be improved further ? Is there
any other method ?
Alex & Misha
- 15
|
|
|