|
hi,
In the namespace declaration section try to call your dll file.
like
using System;
using name of your dll;
then you will get all avilable types in button click.
Eg:
using System;
using SockDll;
private void button_clcik(object sender, System.EventArgs e)
{
SockDll.MyClass Obj=new SockDll.MyClass();
Obj.Method();
}
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
but on writing Using SockDll;
it gives error
c:\inetpub\wwwroot\WebApplication2\WebForm1.aspx.cs(2): The type or namespace name 'SockDll' could not be found (are you missing a using directive or an assembly reference?)
y it is ???
Regards.
|
|
|
|
|
tell me your .dll is not there in reference folder.
The error is because that perticular dll is there in reference folder.
please check that.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
do u have MSN ID plz come there thay may save our boths time and i can solve it. plz come online
mine is zahid_ash@hotmail.com
Refernce (Tree node) folder has the DLL
thanx
Regards.
|
|
|
|
|
Hi all,
I have a datatable, which I want to query by using LIKE operator like we do in SQL
SQL
Select * from Tab1 where col1 LIKE '%xyz%'
C#
datatable dt
dt.select(...)
Is it possible in C#. Please advice
Thanks
Ruchi
|
|
|
|
|
Yes, it is possible. Check here[^] for an explanation and examples.
Paul Lyons, CCPL Certified Code Project Lurker
|
|
|
|
|
dear paul,
please re-check whether it is working in table select.
dataset.Table[0].Select("Disp==%sdsd%");
(forget abt the above syntax).
It is not working for me..
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Paul,
I know how to use Select with DataTable. I couldn't find any example for LIKE operator from the link that you specified.
Could you please point out specific example out of that link.
Thanks
Ruchi
|
|
|
|
|
Hi, I'm trying to connect to my tv tunner but I don't get any sound. It doesn't allow me to change Audiosource (it's always at SPDIF). There's no way to do it. I have tested my app and the Capture application sample in other computers, with exactly the same result: good video but no sound.
What Am I doing wrong? Neither sample app works to me and my friends...
Thank you
|
|
|
|
|
Well, I've solved it manually by changing settings at the Video Crossbar properties page.
How can I do it programatically?
Thx
|
|
|
|
|
Hi,
In MFC we had a very nice feature where in we can split the form. Can we do the same thing here. I am designing something like Visual Studio, with tool box on one side and a form (actually a plain user control) where in the tools can be dragged and dropped on the form. But when the forms size is increased, as it is a single view we cannot view the tool box. I was hoping to make something so that the tool box and a property grid stay where they are and the form can be resized in a different view.
I may not have explained few things clearly. If you need more info, pls do write and i will try to explain as much as possible. In short its a visual studio, where in i want the tool box at one side not disappear from screen when the design forms size is increased .
Thank you all.
|
|
|
|
|
Hi!
A split form can be achieved with a Splitter (thus the name ) control.
For example, if you add a TreeView , a Splitter and a ListView to your form and set the Dock property of the TreeView and Splitter to Left and the ListView 's Dock to Fill then you get the window layout of Windows Explorer.
You might have to play with the order of your controls so that the splitter behaves correctly.
Regards,
mav
|
|
|
|
|
Hi,
Thanks for the reply mav. I have seen examples with splitter and they all deal only with list view and tree view. I tried to use it with other controls (some user controls ) but was not successful. Please let me know if it can be done with controls other than listcontrol, tree control.
Thanks
|
|
|
|
|
The Splitter can be used with any two controls, you'll just have to take care that both controls are docked, one of them has docking style Fill and that the order of controls is correct.
mav
|
|
|
|
|
|
I have been searching around and have not found anything to directly show how to bind a dataset to a datagridview in C#. This is what I have so far....
string mySQLCommand = "SELECT * FROM unit where status = 1";
SqlDataAdapter myDataAdapter = new SqlDataAdapter (mySQLCommand,mySQLConnection);
myDataAdapter.Fill(myDataSet, "unit");
I was looking for a way at this point to do something like
myDataGridView.SetDataBinding(...)
But have not found anything pointing in this direction. Has anyone done this before and is it as easy as I keep reading about?
Thank you in advance...
|
|
|
|
|
I have a .NET EXE, and I have a .NET DLL, which is running as an Explorer Bar (under IE). I'd like to call a method in the active Explorer Bar in order to pass data from the EXE to the Explorer Bar. They are both running on the same computer, but in different processes.
It would seem like this is a task for .NET remoting, but I don't really want to establish a channel for each Explorer Bar, and besides, this aspect isn't critical.
So it seems that maybe this task is better suited for COM? Can someone confirm or reject this? I thought .NET was going to kill COM, but in this case, it seems that COM is more appropriate than .NET remoting.
Thanks,
Arun
|
|
|
|
|
I have a table where the fields are 'CustID' and 'CustName'. In a
checkedListBox control on winforms, I want to display 'CustName', but when a user selects 'CustName', I want to get the selected 'CustName''s 'CustID', so that I can run the query on 'CustID' and display 'CustName', how can this be done. or how to add more than one column in a checkedlistbox control, which displays 'CustName' and 'CustID'.
I really appreciate ur help.
Thanks,
abhi
|
|
|
|
|
Hi...
I have a string that contains some text... as most string does...
My string could look like this
string whatever = "Hello \n I come from a city!";
But i want to save it to a textfile!
i thought about making it to a byte and save it with the streamwriter!
but i dont know how to do it!
Can anyone tell me how to save a string to a txt document?
QzRz
|
|
|
|
|
I would suggest reading on MSDN, in particular the System.IO Namespace[^] and Working with I/O[^] in the .NET Framework Developer's Guide. The following is a quick example:
using(StreamWriter s = new StreamWriter("file.txt"))
{
s.WriteLine("Hello");
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks... it works just great now...!
QzRz
|
|
|
|
|
Just use the overload of SteamWriter's Write method which takes a string as parameter.
www.troschuetz.de
|
|
|
|
|
Hello,
I would like to simulate CMYK printing by drawing four halftoned images on the screen, one after the other, as a printing press would do, i.e. print cyan, then magenta, then yellow and finally black. Now, If I use:
g.DrawImage(cyanImage, 0,0);
g.DrawImage(magentaImage, 0,0);
g.DrawImage(yellowImage, 0,0);
g.DrawImage(blackImage, 0,0);
the white pixels of an image will paint over the previous colors. If I use alpha blending, colors will be merged, but they unfortunately become fainter by the aplha factor.
What I would like to see happening is to draw one image on the graphics or canvas such that only these pixels of that image will be painted which are above a certain threshold, i.e. not blank, or the areas where in a real printing role the paint would be.
Alternatively, I could combine these images, like professional tools can do. Then it would be sufficient to draw the combined image.
How could I achieve that in C# using the Graphics/Imaging classes?
What I started doing is the following code. Thanks for any hints.
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Data;
using System.Windows.Forms;
namespace MergedImages
{
public class MergedImage : System.Windows.Forms.UserControl
{
private System.ComponentModel.Container components = null;
private System.Drawing.Image cyanImage;
private System.Drawing.Image magentaImage;
private System.Drawing.Image yellowImage;
private System.Drawing.Image blackImage;
public MergedImage()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
private void InitializeComponent()
{
cyanImage = Image.FromFile(@"c:\tmp\cyan.bmp" );
magentaImage = Image.FromFile(@"c:\tmp\magenta.bmp");
yellowImage = Image.FromFile(@"c:\tmp\yellow.bmp" );
blackImage = Image.FromFile(@"c:\tmp\black.bmp" );
//
// MergedImage
//
this.BackColor = System.Drawing.Color.White;
this.Name = "MergedImage";
this.Size = new System.Drawing.Size(620, 620);
}
#endregion
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.Clear(this.BackColor);
float[][] ptsArray ={
new float[] {1, 0, 0, 0, 0},
new float[] {0, 1, 0, 0, 0},
new float[] {0, 0, 1, 0, 0},
new float[] {0, 0, 0, 0.25f, 0},
new float[] {0, 0, 0, 0, 1}};
ColorMatrix clrMatrix = new ColorMatrix(ptsArray);
ImageAttributes imgAttributes = new ImageAttributes();
imgAttributes.SetColorMatrix(clrMatrix,
ColorMatrixFlag.Default,
ColorAdjustType.Bitmap);
g.DrawImage(cyanImage, 10,10);
g.DrawImage(magentaImage, 110,10);
g.DrawImage(yellowImage, 210,10);
g.DrawImage(blackImage, 310,10);
g.DrawImage(cyanImage, 0,0);
g.DrawImage(magentaImage, 0,0);
g.DrawImage(yellowImage, 0,0);
g.DrawImage(blackImage, 0,0);
g.DrawImage(cyanImage,
new Rectangle(300,300, cyanImage.Width, cyanImage.Height),
0, 0, cyanImage.Width, cyanImage.Height,
GraphicsUnit.Pixel, imgAttributes);
g.DrawImage(magentaImage,
new Rectangle(300,300, magentaImage.Width, magentaImage.Height),
0, 0, magentaImage.Width, magentaImage.Height,
GraphicsUnit.Pixel, imgAttributes);
g.DrawImage(yellowImage,
new Rectangle(300,300, yellowImage.Width, yellowImage.Height),
0, 0, yellowImage.Width, yellowImage.Height,
GraphicsUnit.Pixel, imgAttributes);
g.DrawImage(blackImage,
new Rectangle(300,300, blackImage.Width, blackImage.Height),
0, 0, blackImage.Width, blackImage.Height,
GraphicsUnit.Pixel, imgAttributes);
}
}
}
|
|
|
|
|
|
Code using Windows/Web Forms have both "Code View" and "Design View". AFAIK, the IDE knows when to provide the "Design View" by checking the first class declaration in the codefile.
What if I create an alternate editor for a codefile, something like "Design View", is it possible to integrate it into the IDE? If so, can anyone give me a pointer or two to an article or documentation?
-Maki
|
|
|
|
|