|
Hai friends,
i have to export a table from any of the database types(Text,Access or Excel) to excel...provided that the datatypes of the Columns should retain...
To be clear....
I have to craete a new Excel Sheet whose datas will be imported from other database tables..along with their corresponding datatypes...
I tried to create a new excel importing datas from a textfile..but all datas are in general datatype format....How can i get the solution...
Kindly help me...
Thanx in advance...
|
|
|
|
|
Hi,
i've tried 'google'ing to find any article on how i might be able to read the metadata of a file or .net 2.0 rc1 assembly that i've built (e.g. the date the file was last modified, or the author of the assembly, it's version etc), but i seem to have hit a bit of a brick wall, i'm sure there must be a simple (or not) way to read this kind of information about a file programmtically.
any help or nudges in the right direction will be greatly appreciated
Thanks in advance.
Afzal "AV-E" Hassen
|
|
|
|
|
I'm not sure if it will give you all the info you need, but you can do:
Assembly asm = Assembly.Load(filename);
then use properties/methods of asm:
asm.GetName().Version
You can also get attributes of an assembly by using GetCustomAttributes(typeof(AssemblyTitleAttribute), true)
|
|
|
|
|
Try this...
using System;
using System.IO;
using System.Reflection;
public class Meta
{
public static int Main( )
{
// First load the assembly.
Assembly a = Assembly.LoadFrom("hello.exe");
// Get all the modules that the assembly supports.
Module[] m = a.GetModules( );
// Get all the types in the first module.
Type[] types = m[0].GetTypes( );
// Inspect the first type.
Type type = types[0];
Console.WriteLine("Type [{0}] has these methods:", type.Name);
// Inspect the methods supported by this type.
MethodInfo[] mInfo = type.GetMethods( );
foreach ( MethodInfo mi in mInfo )
{
Console.WriteLine(" {0}", mi);
}
return 0;
}
}
|
|
|
|
|
Thanks guys. i'll give it a shot
Afzal "AV-E" Hassen
|
|
|
|
|
Hi gurus,
I'd like to know how to do the two following operations on TextBox controls:
- Moving the cursor to the end of the text, so the new added lines are always visible without moving the scroll bar.
- Setting the focus on a TextBox. the Focus() method does not work
Thanks for the help.
fred.
There is no spoon.
|
|
|
|
|
answers:
1. <textboxname>.Select();
SendKeys.Send("{END}");
2. <textboxname>.Select();
Sheel Gohe
|
|
|
|
|
1) I have found another alternative by using the SelectionStart set to Text.Length and ScrollToCaret method.
2) The Select() method does not set the caret to the wanted control. Actually the Focus() method was right, the wrong thing was that I was modifying the interface through a secondary thread.
Thanks for the help.
There is no spoon.
-- modified at 11:05 Wednesday 18th January, 2006
|
|
|
|
|
this is my class code
i wan't to get ip address of each client which is getting connected
listen class
public class listen
{
TcpListener server=null;
Thread tcpthread=null;
client[] cl=new client[3];
public listen()
{
//
// TODO: Add constructor logic here
//
}
public void startlisten()
{
Int32 port = 3310;
IPAddress localAddr = IPAddress.Parse("192.168.0.6");
// TcpListener server = new TcpListener(port);
server = new TcpListener(localAddr, port);
// Start listening for client requests.
server.Start();
// Enter the listening loop.
for(int i=0;i<3;i++)
{
cl[i]=new client();
cl[i].status=true;
}
Boolean flag;
while(true)
{
try
{
flag=false;
// Perform a blocking call to accept requests.
// You could also user server.AcceptSocket() here.
for(int i=0;i<3;i++)
{
if(cl[i].status==true)
{
cl[i]= new client(serverAcceptTcpClient());
tcpthread=new Thread(new ThreadStart(cl[i].getClient));
tcpthread.Start();
flag=true;
break;
}
}
if(flag!=true)
{
//MessageBox.Show("All Clients Busy");
}
}
catch(Exception se)
{
}
}
}
public void stoplisten()
{
server.Stop();
}
}
client class
public class client
{
TcpClient tcpClient;
public Boolean status;
// Buffer for reading data
Byte[] bytes = new Byte[256];
String data = null;
IPAddress localAddr = IPAddress.Parse("192.168.0.6");
public client()
{ //
// TODO: Add constructor logic here
//
//status=true;
}
public client(TcpClient Client)
{
tcpClient =Client;
//
// TODO: Add constructor logic here
//
status=false;
}
public void getClient()
{
try
{
data = null;
// Get a stream object for reading and writing
NetworkStream stream = tcpClient.GetStream();
int i;
// Loop to receive all the data sent by the client.
while((i = stream.Read(bytes, 0, bytes.Length))!=0)
{
// Translate data bytes to a ASCII string.
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
// Process the data sent by the client.
string replyMsg = data;
clamdCommand x=new clamdCommand();
replyMsg=x.Command(replyMsg);
int lowerport=int.Parse(ConfigurationSettings.AppSettings.Get("lowerport"));
int upperport=int.Parse(ConfigurationSettings.AppSettings.Get("upperport"));
for(int y=lowerport;y
|
|
|
|
|
You forgot to mention what your problem is.
---
b { font-weight: normal; }
|
|
|
|
|
i want to get ip address of each client on server when it is getting connected.
Above code is for server
how can i get "RemoteEndPoint"
but not getting
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
But what is the problem? Do you get an error message?
---
b { font-weight: normal; }
|
|
|
|
|
Hello
i have wasted lot of time.
1I want to put a command button in the datagrid in one of the column. I got a piece of code from this site and i have added to my project. it is working fine except i am having a major issue. when i click on the button, i am poping a form. if i click again, the form gets popped up twice, if i click again, 3 times the form gets popped up. is it due to the events get added up every time when i click on the button. my code is like this
buttonColStyle = new DataGridButtonColumn(1)
buttonColStyle.HeaderText = "Browse";
buttonColStyle.MappingName = ObjDataColumn.ColumnName;
buttonColStyle.CellButtonClicked +=
new DataGridCellButtonClickEventHandler(HandleCellButtonClick);
GridTableStyle.GridColumnStyles.Add(buttonColStyle);
this.DGDetails.MouseDown += new MouseEventHandler(buttonColStyle.HandleMouseDown);
this.DGDetails.MouseUp += new MouseEventHandler(buttonColStyle.HandleMouseUp);
wilson
|
|
|
|
|
dear wilson you have to check the instance of the popped-up form every time you click the button. If form's instance already exist then dont make use of new keyword just use the form's "show" method.
Use this method to check instance of the form (may be this could be useful)
//***********Start**********
private Form isFormAlreadyLoaded(Form ToBeLoadedForm)
{
foreach (Form LoadedForm in this.MdiChildren)
{
if ((LoadedForm.Name == ToBeLoadedForm.Name) && ((LoadedForm.Text.Trim ()) == ToBeLoadedForm.Text.Trim()))
{
return LoadedForm;
}
else
{
return ToBeLoadedForm;
}
}
return ToBeLoadedForm;
}
//***********End**********
regards
Sheel Gohe
|
|
|
|
|
I have a Windows application written c# 1.1 that uses embedded crystal reports. I have 60 users who all use the exe which is accssed from a shared folder on the network. The problem is I still need to install the application on all client machines so as crystal registers properly. Is there away around this so as I dont have to install the application on all client machines?
|
|
|
|
|
can we fast track or slow track any video in C# to produce the effects as are seen now-a-days during CRICKET matches...i know ASF files can be slow/fast tracked using the windows media player object........but is there any better way....
|
|
|
|
|
I have a form i am overriding the WndProc and i am trying to get a scancode for a WM_CHAR so i can get the correct char text. This is for internationalization. I have read that the key's scancode is embedded in the LParam parameter of the WndProc message. How do i extract this?
Below is some of the code i am working on. It is very possible i am tackling the problem wrong? I am not a C++/Win32 expert. From all my reading it appears that to have the best chance at converting a foreign char correctly one uses a combination of: 1) keyboard layout; 2) scancode; 3) virtual key. I appreciate the advice. I have blown quite a few brain cells working on this.
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_CHAR:
// get keyboard layout
// keyboard layouts map scan codes to virtual keys;
IntPtr keyboardLayout = GetKeyboardLayout(0);
// get keyboard state
byte[] keyboardState = new byte[256];
GetKeyboardState(keyboardState);
// ???
// get scan code
// get virutal key
Keys virtualKey = m.WParam;
// convert scan code to ascii
StringBuilder result = new StringBuilder();
result.Capacity = 2;
if (ToAsciiEx(virtualKey, scanCode, keyboardState,
result, 0, keyboardLayout) == 1)
// display char text
this.Text = result;
}
}
|
|
|
|
|
In an open source programm called Putty i found the answer. I do not fully understand the bit shifting and &ing but it works. I know it is a rubik's cube type maneuver to "pop out" a certain set of bits. It extracts the scancode from the LParam value. For anyone who wants to save 20 hours of research. The below is not an obvious find if you tried researching the internet starting with zero knowledge.
For WM_KEYDOWN
uint virtualCode = (uint)m.WParam;
uint keyState = (uint)m.LParam;
uint scanCode = keyState >> 16 & 0xFF;
Here you have the core values you need to resolve keys to text using various Win32 functions.
|
|
|
|
|
Keystate is a 32 bit int: AA BB CC DD (AA BB CC and DD are placeholders for the 4 bytes)
After shifting it 16 bits you have the value: 00 00 AA BB
Finally anding with 00 00 00 FF will zero out the value in the 3 high bytes (only needed in one of them) leaving scancode containing: 00 00 00 BB
|
|
|
|
|
Hi frnds,
Trying to read a binary file and write the data from that file to a simple text file.
The format of the data in the binary file is not known under any circumstances.
Can someone plz help me with this ??
Thank you
- Prasadd
|
|
|
|
|
Then you have to decide how you want to display the data in the text file. A hex dump?
---
b { font-weight: normal; }
|
|
|
|
|
As of now i would like to complete the read operation for a .dat file
heading towards Geek-Age !
- Prasadd
|
|
|
|
|
Use the System.IO.File.OpenRead method to open the file, it returns a FileStream object. Use the Read method to read from the stream, then close it.
---
b { font-weight: normal; }
|
|
|
|
|
i wanna display data from a generic xml file to a table view providing a checkbox and while clicking the send button the checked records alone should be taken to the next page...
i need suggestions .. i dont have any idea of how to do tht..........
thanx in advance
sathy
|
|
|
|
|
Hi I'm using a datagridview bound to dataset.
I use the datagridview to be able to add/edit/delete data.
When the user clicks save button, the changes made to the datagridview
will be reflected in the database.
How do I determine if the row/s are newly added rows?
Thanks so much!
|
|
|
|