|
Hi,
A solution is to store the full row in the session object :
Session["selectrow"] = myDataSource.myTable.Rows[dataGridView1.CurrentCell.RowIndex];
Then in the load of the second page your read values from the session object :
mytextBox.Text = ((DataRow) Session["selectedrow"])["mycolumn"].ToString();
|
|
|
|
|
Thanks works nice.
What if I want to go from Datagridview to Datagridview?
|
|
|
|
|
Hi,
What do you mean by "from Datagridview to Datagridview" ?? It's not very clear for me.
|
|
|
|
|
how to delete a commandbarbutton in ms-word that is already created..
and also how to check whether the button is already created..
|
|
|
|
|
Hi guys,
I went through and played with the Example given in .net 2.0 It is working
perfectly fine in 32 bit Os that is XP... and i am getting the error
AccessViolation in Vista...Please help me how to solve it....My Vista is aslo
32 bit..
Unhandled Exception : System.AccessViolationException: Attempted to read or
write protected memory. This is often an indication that other memory is
corrupt.
at NetSDKSamples.LibWrap.DsBrowseForContainerW(DSBrowseInfo & info)
at NetSDKSamples.App.Main()
I have also tried running the exe as an Administrator..still the same result.
I have also tried runnint it from CMD promprt where cmd is also run as
administrator...still same result..
I am running out of ideas now... please help...me..
Path of Sample on My machine...
C:\Program Files\Microsoft Visual Studio
8\SDK\v2.0\LateBreaking\PlatformInvoke\WinAPIs\ActiveDir
Code:
//-----------------------------------------------------------------------
// This file is part of the Microsoft .NET Framework SDK Code Samples.
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//This source code is intended only as a supplement to Microsoft
//Development Tools and/or on-line documentation. See these other
//materials for detailed information regarding Microsoft code samples.
//
//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//PARTICULAR PURPOSE.
//-----------------------------------------------------------------------
// ActiveDir.cs
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
/*
typedef struct
{
DWORD cbStruct;
HWND hwndOwner;
LPCWSTR pszCaption;
LPCWSTR pszTitle;
LPCWSTR pszRoot;
LPWStr pszPath;
ULONG cchPath;
DWORD dwFlags;
BFFCALLBACK pfnCallback;
LPARAM lParam;
DWORD dwReturnFormat;
LPCWSTR pUserName;
LPCWSTR pPassword;
LPWStr pszObjectClass;
ULONG cchObjectClass;
} DSBROWSEINFOW, *PDSBROWSEINFOW;
*/
// all strings in structure will be marshaled as LPWStr
[ StructLayout( LayoutKind.Sequential, CharSet=CharSet.Unicode )]
public struct DSBrowseInfo
{
public int structSize;
private IntPtr dlgOwner;
public string dlgCaption;
public string treeViewTitle;
public string rootPath;
// in/out string must be declared as String in struct/class,
// not as StringBuilder
public string path;
public int pathSize;
public int flags;
private IntPtr callback;
private IntPtr lParam;
public int returnFormat;
public string userName;
public string password;
public string objectClass;
public int objectClassSize;
};
public class LibWrap
{
//int DsBrowseForContainer(PDSBROWSEINFO pInfo);
[ DllImport( "dsuiext.dll", CharSet=CharSet.Unicode )]
public static extern int DsBrowseForContainerW( ref DSBrowseInfo info );
public const int DSBI_ENTIREDIRECTORY = 0x00090000;
}
class App
{
public const int MAX_PATH = 256;
// Must be marked as STA since default is MTA. DsBrowseForContainerW calls
// CoInitialize, which initializes the COM library as STA.
[ STAThread ]
public static void Main()
{
// initialize all members
DSBrowseInfo dsbi = new DSBrowseInfo();
dsbi.structSize = Marshal.SizeOf( dsbi );
dsbi.dlgCaption = "The container picker";
dsbi.treeViewTitle = "Pick a container for this example.";
dsbi.path = new string( new char[ MAX_PATH ]);
dsbi.pathSize = dsbi.path.Length;
dsbi.flags = LibWrap.DSBI_ENTIREDIRECTORY;
dsbi.objectClass = new string( new char[ MAX_PATH ]);
dsbi.objectClassSize = dsbi.objectClass.Length;
Console.WriteLine( "Call DSBrowseForContainer..." );
int status = LibWrap.DsBrowseForContainerW( ref dsbi );
Console.WriteLine( "The status is " + status );
if( status == 1 )
{
Console.WriteLine( "The path is " + dsbi.path );
}
else
{
Console.WriteLine( "Call failed!" );
}
}
}
|
|
|
|
|
Hi,
Is there any one who has encountered this issue. Basically my goal is to open the Active Diectory Container Browser using c#. I tried the above example in Vista. it does open it but when i try to close it i am getting the AccessViolation Exception. Please help me. As far as i know there is problem in above structure.
|
|
|
|
|
i am biggner in c#.
i want to how to get multiple value from listbox or dropdownlistbox.
|
|
|
|
|
Take a look at the SelectedItems property.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
sir,
i try with selecteditem property,but i dont get success.
|
|
|
|
|
Ajeet mittal wrote: i try with selecteditem property
So use the SelectedItems (emphasis on the plural) property as I said.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
and dont forget to set ListBox.SelectionMode to an appropriate value.
|
|
|
|
|
Hello All,
I am developing a shopping cart and both registered users and anonymous users can shop. The problem iam facing is with anonymous user how to create a visitorId so that i can link them to shopping cart. Visitor ID should be unique ie for every user, do i use session for this. Any suggestions guys.
Best Regards, Shilpa.
Thanks in Advance for your help. Best Regards
|
|
|
|
|
Hi,
You can use the SessionID property of the session. it's unique.
You can also create your own ID (a guid for example) and store it in the session object :
Guid VisitorID = Guid.NewGuid();
Session["VisitorId"] = VisitorID;
|
|
|
|
|
Hello everyone,
I have realised that there are Visual differences between the Button images. Some of them are square and look like the old fashion Windows Application and some like Windows XP.
It seems whenever the code is written in Visual Studio 7 once they are opened in Visual Studio 8 even after the converstion is successful, the button image looks like the old windows 3.1.
Here is an example for the square old windows style:
http://www.codeproject.com/listctrl/listview.asp[^]
Here is an example to show the rounded Button Windows XP look alike is this example:
http://csharp.simpleserial.com/[^]
What I find strange is that if I start a new project in Visual Studio 8 it creates Button shown in example Two but if I build on a project which was initially created in Visual Studio 7 then all the buttons look squared and old style including the Buttons which were added to the application in Visual Studio 8.
I have checked the Button Propeties and they are identical!!! Can someone tell me how we can change the Button Shown in example one into the one shown in example two?
Thank you so much for your help and have a great day.
Khoramdin
-- modified at 22:11 Thursday 1st March, 2007
|
|
|
|
|
Hi,
the esthetic improvement in some controls is called "VisualStyles"; you must enable
it explicitly to get it, and it needs/uses a more recent version of one of the
system's dll files.
There are different ways to enable VisualStyles, one of them is calling
Application.EnableVisualStyles() before Application.Run().
But is exists only since .NET 2.0
For more info please search CodeProject for VisualStyles, or read the documentation.
|
|
|
|
|
how to import multiple dll files in c#.
|
|
|
|
|
Hi
??
for N dll files, repeat N times what you do to import one dll !?
|
|
|
|
|
Hi ı need MCTS Self-Paced Training Kit (Exam 70-536) ebooks , ı don't know find it please help me
kaan06tr@gmail.com
Kaan
|
|
|
|
|
just buy the books already, ebooks are usually pirated.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All:
I am trying to draw small points ontop of an origin background. I am trying to plot points in a 4 coordinate background. So I want the background to be stationary and the points to change given the incoming values. How can I do this? Right now my background is redrawing everytime I draw the small square so it looks awful! Please help!
Laura
|
|
|
|
|
You need to turn on double buffering, probably. Sorry, you need to google for the code, don't know it off hand.
You also need to post your code, so we can see how you're going about it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a slight bug in one of my programs. It is a program that involves databinding with ADO.NET 2.0. My main form is bound to one of the tables. I have another form and a combo-boxon my main form that is bound to the other table (there are only two) in the database. When I run the application, I find that the individual forms work correctly, but the combo-box does not update if I add a new field in the other form unless I restart the application after closing it. I need a way to refresh that combo-box! Please help!
Person ejbing = new Person();
ej.SayGoodbye();
|
|
|
|
|
I believe the correct form is to do another fill in your main form after returning.
dataAdapter.Fill(dataSet, [table]);
Hope this helps
Started out with nothing and still have most of it left!
|
|
|
|
|
Thanks! I'll have to give it a whirr. You said:
dataAdapter.Fill(dataSet, [table]);
Person ejbing = new Person();
ej.SayGoodbye();
|
|
|
|
|
Hi all I am new to C# and real new to drawing with it. I have been looking online and have been unsuccessful in finding tutorials or examples in what I am trying to do. I am trying to draw a very small square about 1cm in size. I want to draw it at a certain location on the form. Does anyone know how to do this or can help point me in the right direction with sample code. I have a timer implemented and when the timer interrupt occurs I want to draw the small square in a differnt location in the form. Right now its not drawing anything. I call my paint function in the timer event function by doing the following:
this.Paint += new PaintEventHandler(XYZ_Paint);
But nothing gets displayed to the form, not even a simple line or anything. Why is this? Please help. I am using C# and Visual Studio 2005.
Thanks,
Laura
|
|
|
|