|
to select data from datagrid try out
dataGrid1[row number,column number].ToString();
and to bind combo box try
Databasecb.DataSource=results.Table["table name"];
Databasecb.DisplayMeember="column name to display";
rahul
|
|
|
|
|
rahul
i tried doing what u sugested with the combo bue there is no option of results.Table["Table name"] so i tried Databasecb.DataSource=results.TableName;
however this gives me the following exception
Complex DataBinding accepts as a data source either an IList or an IlistSource
Saira
|
|
|
|
|
if Databasecb is datatable or dataview then try
Databasecb.DataSource=results;
Databasecb.DisplayMember="column name to display";
rahul
|
|
|
|
|
thanks rahul
u just solved the problem
Saira
|
|
|
|
|
My project requires to change Default Web Site of IIS to other name (example: medi) for browse http://medi instead of http://localhost. I don't know how to code in C#. Please give me a clue to solve.
Thanks.
|
|
|
|
|
Perhaps you can add the domain in the host file if you only want the name on your local machine.
If it is a network wide setting, you have to do it in your dns settings.
|
|
|
|
|
Hi,
Recently I have been working on creating an ActiveX DLL (for performing Image Scan using TWAIN and C#) which could be invoked using a Javascript call from an HTML page and the scanned image could be displayed within the page. I got most of the things but when I invoke the TWAIN driver, it displays the scanning control, I can perform New Scan multiple times within it but when I click at Accept nothing happens, the same code works perfectly when I invoke it from a Windows Form.
I trapped Windows Messages, it seems that when I do a call to the ActiveX from HTML it does not send any message back when I click Accept in the Scanning control.
The code for using TWAIN scanning using C# writtem by NETMaster was the guide for my current activity.
Help would be highly appreciated.
Regards,
|
|
|
|
|
Hi,
I developed P2P file transfers application using C#.NET in PC its working fine , but in Windows Mobile 5.0 , the chunks downloading is not complete, after downloading 4 or 5 chunks(32kB), its stopping.How to speed up the application?..
Anybody have idea?please help me..
|
|
|
|
|
Hi Sri harini,
being a bit more specific would be helpful. What kind of protocol are you using (TCP or UDP)? How do you buffer the chunks? How does it stop, with an exception? Maybe you should also post relevant parts of your code.
Regards
Sebastian
|
|
|
|
|
Hi Sebastian
We are using the following code to Read data,using TCP protocol.How to set the receive timeout option in Windows Mobile.Bcoz its throwing exception when we use SetSocketOption Method.
Please advise.
public void ReadData()
{
Byte[] buffer=null;
Socket s=null;
int port = threadVars.port;
int chunksize=threadVars.chunksize;
int cid = threadVars.cid;
int fileid = threadVars.fileid;
string hash = threadVars.chnkhash;
readlocked = false;
s=new Socket( SocketAddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
s.Bind(new IPEndPoint(IPAddr, port));
s.Listen(1);
Socket actualReader = s.Accept();
NetworkStream DataStream = new NetworkStream(actualReader);
int offset = 0;
int bytesActuallyRead = 0;
int i=0;
do
{
i = i++;
bytesActuallyRead = DataStream.Read(buffer, offset, buffer.Length - offset);
offset += bytesActuallyRead;
if (bytesActuallyRead == 0)
{
break;
}
Thread.Sleep(10);
}
while(actualReader.Connected && i<1000);
parentController.SocketReadComplete(false,cid, fileid, buffer,chunksize,hash);
}
DataStream.Flush();
DataStream.Close();
s.Close();
}
Thanks
Sri harini
|
|
|
|
|
Does anyone know how I can start or get more info on how to capture an A/V (audio/visual) stream? either directly like from a mic or a (web)cam or from a file.
Any clues?
Much appreciated.
Got a coding problem? Hand it to the CodeDevil!
______________________
Its the idiot who stops learning and the wise that keep asking you questions!!!!
|
|
|
|
|
Hi,
I have devolped one .net application using c#.net, according to my application requirement it should run only in 1024*768 resolution..
so, how can i get the resolution for a particular machine and change it to my desired resolution?
is that possible?
Jaydeep
|
|
|
|
|
for getting current resolution of system u can use
Screen.PrimaryScreen.Bounds.Height;
Screen.PrimaryScreen.Bounds.Width;
to change the resolution of system there is no direct way u have to use some window API's
rahul
|
|
|
|
|
It is generally bad practice to change the resolution on your users' machines. However, here is a good article about how to do it in C#:
Using P/Invoke to Call Unmanaged APIs from Your Managed Classes[^]
See the section: Task 2: Changing the Display Resolution
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hello,
Friends, I want to pass parameters to a process while starting. And in process get
that parameters. How to do that.
Rahul Kulkarni
|
|
|
|
|
RahulRKulkarni wrote: I want to pass parameters to a process while starting
Use overload of Process.Start that takes an arguments parameter.
RahulRKulkarni wrote: And in process get that parameters
Change the main method of application to Main(String[] args) . args will conatin the passed command line parameters.
"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
|
|
|
|
|
Thank You very much.
It works fine...
Rahul Kulkarni
|
|
|
|
|
I am having a problem on MS Vista with balloon tips not showing, even with simple code like:
notifyIcon1.ShowBalloonTip(3000, "Test", "This is a test ", ToolTipIcon.Info);
Is there a new peice of code I should be using?
Thanks, Ben.
|
|
|
|
|
Are you using the Enable Visual Styles in your application?
[STAThread]<br />
static void Main() <br />
{<br />
Application.EnableVisualStyles();<br />
Application.Run(new Form1());<br />
}
|
|
|
|
|
hi,
how can i hide the exit, minimize and maximize buttons that appear on the top right side of the scree inside the title bar of the form. And if it is possible, also tell me how to modify the code and the action that those button do when clicked.
thanks in advance
jamil abou khalil
|
|
|
|
|
to remove. go to publishing Designer selects the form and change the property ControlBox to false.
to intercept.
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;
protected override void WndProc(ref Message m)
{
if( m.Msg == WM_SYSCOMMAND)
{
if( (int) m.WParam.ToInt32() == SC_CLOSE )
{
if (ProjectIsOpen)
{
return;
}
else
{
this.Close();
Application.Exit();
}
}
}
base.WndProc (ref m);
}
|
|
|
|
|
hi,
first thanks for your reply. second i want to ask you a more detailed question. what if i want to hide only the close button and the maximize button and keep the minimize button. The property ControlBox when set to false hides the three buttons together even if i try to set the maximizebox to true it want appear.
i hope u have a solution for that.
jamil abou khalil
|
|
|
|
|
try it.
private const int SC_CLOSE = 0xF060;
private const int SC_MAXIMIZE = 0xF030;
private const int SC_MINIMIZE = 0xF020;
private const int SC_RESTORE = 0xF120;
private const int MF_GRAYED = 0x1;
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern int EnableMenuItem(IntPtr hMenu, int wIDEnableItem, int wEnable);
private void Disable_opt()
{
EnableMenuItem(GetSystemMenu(this.Handle, false), SC_CLOSE, MF_GRAYED);
EnableMenuItem(GetSystemMenu(this.Handle, false), SC_MAXIMIZE, MF_GRAYED);
EnableMenuItem(GetSystemMenu(this.Handle, false), SC_MINIMIZE, MF_GRAYED);
EnableMenuItem(GetSystemMenu(this.Handle, false), SC_RESTORE, MF_GRAYED);
}
|
|
|
|
|
In C Language how can we do the following..
conversion of the (int) to char
conversion of the (int) to (unsigned char) ------------interger to unsigned char
conversion of the (int) to (unsigned char *) ----------------interger to unsigned char pointer
Thanks..
|
|
|
|
|
Wrong message board
"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
|
|
|
|