|
I want to retrieve the data from Excel Sheet row and column wise and then I want to manipulate the data and then I want to store it in data base. using VS 2008 C#
|
|
|
|
|
amaankhan wrote: I want to retrieve the data from Excel Sheet row and column wise and then I want to manipulate the data and then I want to store it in data base. using VS 2008 C#
Is there a question here or are you assuming that someone is going to post a working program for you?
|
|
|
|
|
i just need basic help in this. how to connected excel and retrieve the data by row and column,,,,,,,, i need some example's....... i will make the program........
Thanks for reply
|
|
|
|
|
amaankhan wrote: i need some example's
Well you need to search for them! Go to the Articles page here on CodeProject and search for what you need; also use MSDN and Google.
|
|
|
|
|
You can use ole db for reading data from excel file.
|
|
|
|
|
Hi
I am still a bit of a novice to C# Programming, but I have a function that returns me a Object, and what I am stuck on is how to convert this to binary in order to transmit down a pipe. The function returns a List.
Can anyone out there help me, please?
|
|
|
|
|
|
Hi
Thanks for your reply.
You have to excuse me, but as I said, I am a bit of a novice, is there some kind of example I could follow? Or a snippet of code?
|
|
|
|
|
BinaryFormatter with example[^]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
The link to MSDN in the original post holds examples in multiple languages. My apologies for not pointing out
I are Troll
|
|
|
|
|
Hi
Thanks, yes, I have seen the example. Do you know whether this would work with passing the binary data into a namedpipeclient and server stream? If so, how would you pass this data in?
|
|
|
|
|
You can choose to serialize an object as binary data, or as XML. If it's binary data, I'd convert it to Base64[^] before sending.
Next step would be building the sending and receiving parts. I haven't used pipes[^] myself in a project yet, but you might find a good start at MSDN[^].
I are Troll
|
|
|
|
|
Hello,
I have a P/Invoke to a C++ function:
int dll_registerAccount(char* uri, char* reguri, char*);
So I have done this:
[DllImport("pjsipDlld")]
static extern int dll_registerAccount(IntPtr uri,
IntPtr reguri);
When I use this in my code:
success = dll_registerAccount("Bob", "Joe");
I get the following error message:
cannot convert from string to System.IntPtr
Am I going about this the wrong way?
Many thanks for any advice,
|
|
|
|
|
Change the IntPtr in your declaration to string and you might be all set.
|
|
|
|
|
Hi,
when strings are input parameters and the native code is dealing with ANSI, not Unicode, then just typing the parameters as string should be sufficient.
for output parameters, you would need a StringBuilder instance with sufficient capacity; and for Unicode native code, you would have to add "CharSet=CharSet.Unicode" to your DllImport.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hey ppls I made one POS application in C#.Every thing has ended except generating a report
I tried to use Crystal Report. But the wizard asks me to locate the database. But I worked on SQL db(i.e its extension is .mdf and .ldf) ........ so i cant locate my database to the crystal report . So I cant do my report on crystal report.
Can any body gives me a hint. Or may be other reporting system rather than Crystal report if it is better. By the ways I use Visual studio 2008 if it is important.
Thank you.
|
|
|
|
|
CoderForEver wrote: other reporting system rather than Crystal report if it is better
Carving the report by hand into stone is easier than crystal.
Unless you are writting a dedicated reporting package STAY AWAY FROM CR! There is a lot of information about reporting and formatting output here on CP, try a quick search of articles for 'reporting c#'
Then just craft your own as needed. The four steps are:
0. Create a report class that contains what is needed, description, rows and sumation methods.
1. Create a reporting class that just formats the data.
2. ???
3. Profit
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hey budy ,incase if u didnt understand my question, the report is intended to give a daily and monthly report to the company owner to see what kind of items and how much s/he sold.
Thank you.
|
|
|
|
|
Think about a class that creates that information, it's pretty easy. A collection of transactions and add up the cost and income for each one.
WHAT that report is does not matter, you are using a tool that is notoriously labour intensive.
Did you search the CP articles as I suggested? The answer is there for you, choose an approach and impliment it.
If you have a specific problem, then the answer will be more specific.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I've written a code something like this
bool signalled = autoResetEvent.GetActionServerEvent.WaitOne();
if (!signalled)
return "time out";
else
{
}
and when this executes, the thread will block at above first line(as it should) now when I'll call autoResetEvent.Set() it will return true . But what I need to call so that it return a false value ? I tried Reset() but the thread keep blocked.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
The WaitOne() overload always returns true ( or throws an exception ) because it only returns when signalled.
The return bool is used in the other 2 overloads which take a timeout parameter. These can return false if they timeout before being signalled.
BTW, you want to pass false for the mysterious exitContext parameter
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Well, I wanted to cancel the WaitOne . And I've created a class with custom functions...that gonna help me
Here it is :
public class XAutoResetEvent : EventWaitHandle
{
public XAutoResetEvent(bool initialState)
: base(initialState, EventResetMode.AutoReset)
{ }
bool wasCancelled = false;
public void CancelWait()
{
wasCancelled = true;
this.Set();
}
public bool XWaitOne()
{
this.WaitOne();
if (wasCancelled)
{
wasCancelled = false;
return false;
}
else
return true;
}
}
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
The card image has rounded corners instead of square ones. When you drag it around the form it gets the correct transparency in the direction of travel but the direction you came from gets that really cool "whatever was on drawn over me last" effect. I know that the issue is that the pixels behind the control were never drawn to begin with, so there's no data for the transparency. Anyone know of a solution to it?
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
Card cTest = new Card();
cTest.Location = new Point(5, 5);
cTest.CardFace = Properties.Resources.AceClub;
Controls.Add(cTest);
Card cTest2 = new Card();
cTest2.Location = new Point(50, 5);
cTest2.CardFace = Properties.Resources.AceClub;
Controls.Add(cTest2);
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
}
}
public partial class Card : UserControl
{
Bitmap _CardFace;
Boolean _bMouseDown = false;
Point _pMouse;
public Bitmap CardFace
{
get { return _CardFace; }
set
{
_CardFace = value;
Width = _CardFace.Width;
Height = _CardFace.Height;
}
}
public Card()
{
InitializeComponent();
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
SetStyle(ControlStyles.Opaque, true);
BackColor = Color.Transparent;
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics gGraphics = e.Graphics;
gGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
gGraphics.DrawImage(CardFace, new Point(0, 0));
}
protected override void OnPaintBackground(PaintEventArgs e)
{
}
protected override void OnMouseDown(MouseEventArgs e)
{
_bMouseDown = true;
_pMouse = e.Location;
BringToFront();
}
protected override void OnMouseUp(MouseEventArgs e)
{
_bMouseDown = false;
}
protected override void OnMouseMove(MouseEventArgs e)
{
if (Capture && _bMouseDown)
{
Point P2CP = Parent.PointToClient(Cursor.Position);
Location = new Point(P2CP.X - _pMouse.X, P2CP.Y - _pMouse.Y);
}
}
}
|
|
|
|
|
Try taking a look at this excellent article from here on CP. Per Pixel Alpha Blend in C#[^].
From your description of your problem, it sounds as if this should do the trick.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Why can't I get this to display how many answers are correct which are entered by the user? What am I doing wrong? Here's what I have.
using System;
class Drivers_License_Exam
{
static void Main()
{
char[] exArray = new char[] { 'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A' };
char[] userArray = new char[20];
char ansHold;
char[] correct = new char[20];
for (int i = 0; i < userArray.Length; i++)
{
Console.Write("Question #{0}: ", (i + 1));
ansHold = Convert.ToChar(Console.ReadLine());
ansHold = Char.ToUpper(ansHold);
while (ansHold < 'A' || ansHold > 'D')
{
Console.WriteLine("Invalid answer, please enter a letter A through D");
Console.Write("Question #{0}: ", (i + 1));
ansHold = Convert.ToChar(Console.ReadLine());
ansHold = Char.ToUpper(ansHold);
}
userArray[i] = ansHold;
}
TotalCorrect(correct);
}
public static void TotalCorrect(char[] userAnswers)
{
char[] examAnswers = new char[] { 'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D', 'B', 'C', 'D', 'A', 'D', 'C', 'C', 'B', 'D', 'A' };
int[] wrongAnswers = new int[20];
int j = 0;
int countCorrect = 0;
for (int i = 0; i < 20; i++)
{
if (userAnswers[i] == examAnswers[i])
{
countCorrect += 1;
}
else
{
wrongAnswers[j] = i + 1;
j++;
}
}
Console.WriteLine("");
Console.WriteLine("There are {0} correct answer(s).", countCorrect);
}
}
|
|
|
|
|