Click here to Skip to main content
15,920,956 members
Home / Discussions / C#
   

C#

 
Questionhow to read information from pdf files Pin
deepualuru11-Jan-07 18:32
deepualuru11-Jan-07 18:32 
QuestionMonitor letter Drive (D:) Pin
picasso211-Jan-07 18:15
picasso211-Jan-07 18:15 
AnswerRe: Monitor letter Drive (D:) Pin
stancrm11-Jan-07 19:53
stancrm11-Jan-07 19:53 
AnswerRe: Monitor letter Drive (D:) Pin
Nader Elshehabi11-Jan-07 21:37
Nader Elshehabi11-Jan-07 21:37 
QuestionAccessing Image from MS Access. [modified] Pin
Shaurya_Rastogi11-Jan-07 18:09
Shaurya_Rastogi11-Jan-07 18:09 
QuestionDataGrid Pin
swjam11-Jan-07 17:57
swjam11-Jan-07 17:57 
AnswerRe: DataGrid Pin
Nader Elshehabi11-Jan-07 21:48
Nader Elshehabi11-Jan-07 21:48 
Questionerror in storage.InsertRecords [modified] Pin
tahreen shah11-Jan-07 17:11
tahreen shah11-Jan-07 17:11 
hi!
i tried to embed ur code in my c#.net based windows form de code goes as follows:

namespace Reconciliation
{
///
/// Summary description for Form1.
///

public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
///
/// Required designer variable.
///

private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///

///

// temp class

///
///

/// <param name="disposing" />
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(152, 32);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "import";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(336, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///

[STAThread]



static void Main()
{
Application.Run(new Form1());




}

[DelimitedRecord(",")]
public class temp

{
public string aparty;
public string bparty;
public string date;
public string time;
} ///end temp


private void button1_Click(object sender, System.EventArgs e)
{
SqlServerStorage storage = new SqlServerStorage(typeof(temp));

storage.ServerName = "local";
storage.DatabaseName = "Temp tahreen";

storage.InsertSqlCallback = new InsertSqlHandler(GetInsertSqlCust);


temp[] res = storage.InsertRecords(CommonEngine.ReadFile(typeof(temp), "temp.txt")) as temp[];

}

protected string GetInsertSqlCust(object record)
{
temp obj = (temp) record;

return String.Format("INSERT INTO Temp (Aparty, Bparty, [Date], [Time]) " +
" VALUES ( '{0}' , '{1}' , '{2}' , '{3}' ); ",obj.aparty,obj.bparty,obj.date,obj.time);



}


}
}

now i get error in the line

temp[] res = storage.InsertRecords(CommonEngine.ReadFile(typeof(temp), "temp.txt")) as temp[];

and de error says:

Cannot convert type 'void' to 'Reconciliation.Form1.temp[]' via a built-in conversion

y is it so?



-- modified at 23:27 Thursday 11th January, 2007

tahreen shah

QuestionWhen is a DropDownItem not a DropDownItem? [modified] Pin
JoeRip11-Jan-07 16:55
JoeRip11-Jan-07 16:55 
AnswerRe: When is a DropDownItem not a DropDownItem? Pin
JoeRip11-Jan-07 17:29
JoeRip11-Jan-07 17:29 
AnswerRe: When is a DropDownItem not a DropDownItem? Pin
ChandruIT11-Jan-07 17:37
ChandruIT11-Jan-07 17:37 
GeneralRe: When is a DropDownItem not a DropDownItem? Pin
JoeRip11-Jan-07 18:25
JoeRip11-Jan-07 18:25 
QuestionPreview Type Window (Form) Pin
Nooie11-Jan-07 15:19
Nooie11-Jan-07 15:19 
Questiontopic for final year proj inj c# Pin
Mri1a11-Jan-07 12:56
Mri1a11-Jan-07 12:56 
AnswerRe: topic for final year proj inj c# Pin
Not Active11-Jan-07 14:42
mentorNot Active11-Jan-07 14:42 
GeneralRe: topic for final year proj inj c# Pin
Stephen Hewitt11-Jan-07 15:45
Stephen Hewitt11-Jan-07 15:45 
GeneralRe: topic for final year proj inj c# Pin
J4amieC11-Jan-07 22:28
J4amieC11-Jan-07 22:28 
GeneralRe: topic for final year proj inj c# Pin
Adam Crawford12-Jan-07 4:45
Adam Crawford12-Jan-07 4:45 
GeneralRe: topic for final year proj inj c# Pin
Stephen Hewitt14-Jan-07 12:11
Stephen Hewitt14-Jan-07 12:11 
GeneralRe: topic for final year proj inj c# Pin
ednrgc12-Jan-07 4:04
ednrgc12-Jan-07 4:04 
AnswerRe: topic for final year proj inj c# Pin
Christian Graus11-Jan-07 16:30
protectorChristian Graus11-Jan-07 16:30 
GeneralRe: topic for final year proj inj c# Pin
Stephen Hewitt11-Jan-07 17:19
Stephen Hewitt11-Jan-07 17:19 
GeneralRe: topic for final year proj inj c# Pin
Christian Graus11-Jan-07 17:45
protectorChristian Graus11-Jan-07 17:45 
GeneralRe: topic for final year proj inj c# Pin
ednrgc12-Jan-07 4:06
ednrgc12-Jan-07 4:06 
GeneralRe: topic for final year proj inj c# Pin
ednrgc12-Jan-07 4:08
ednrgc12-Jan-07 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.