Click here to Skip to main content
15,924,036 members
Home / Discussions / C#
   

C#

 
NewsSQLite wrapper class Pin
Igor Sokolsky27-Aug-07 8:22
Igor Sokolsky27-Aug-07 8:22 
Hi All,

I have created a SQLBuilder class as a wrapper to the ADO2.0 SQLite implementation.
It uses refection for automatic database insert, update, delete and select.
Here is the link.

http://www.handymandy.ca/component/option,com_remository/Itemid,62/func,select/id,12/


Usage:
[dbTable("tblComputers",false)]
public class Computer2
{
private string m_Name;
private int m_Id;
private ProcessorType m_CpuType;
private int m_MemorySize;

public Computer2()
{
//connects to default database
SqlBuilder.Instance.connect();
}
[db(false,"Name","text","",false)]
private string Name
{
get { return m_Name; }
set { m_Name = value; }
}
[db(true, "Id", "int", "", false)]
private int Id
{
get { return m_Id; }
set { m_Id = value; }
}
[db(false, "Cpu", "int", "0", false)]
private ProcessorType Cpu
{
get { return m_CpuType; }
set { m_CpuType = value; }
}
[db(false, "MemorySize", "int", "0", false)]
private int MemorySize
{
get { return m_MemorySize; }
set { m_MemorySize = value; }
}

public void Insert()
{
try
{
SqlBuilder.Instance.verifyTableExists(this);
SqlBuilder.Instance.insert(this);
}
catch (ApplicationException e)
{
}
}
public void Update()
{
try
{
SqlBuilder.Instance.update(this);
}
catch (ApplicationException e)
{
}

}
public void Delete()
{
try
{
SqlBuilder.Instance.delete(this);
}
catch (ApplicationException e)
{
}
}
public void Select()
{
try
{
SqlBuilder.Instance.select(this);
}
catch (ApplicationException e)
{
}
}

}
QuestionExpose EventHandler to VBScript [modified] Pin
patrickcbrown27-Aug-07 5:53
patrickcbrown27-Aug-07 5:53 
QuestionNewbie question about "%" Pin
...---...27-Aug-07 5:34
...---...27-Aug-07 5:34 
AnswerRe: Newbie question about "%" Pin
Michael Potter27-Aug-07 5:47
Michael Potter27-Aug-07 5:47 
Questiontrying to create a bitmap from 8bit greyscale using System.Drawing.Bitmap Pin
aei_totten27-Aug-07 4:58
aei_totten27-Aug-07 4:58 
AnswerRe: trying to create a bitmap from 8bit greyscale using System.Drawing.Bitmap Pin
aei_totten27-Aug-07 5:14
aei_totten27-Aug-07 5:14 
Questionhow can i shut down my LAN? any idea Pin
nayabsiddiqi27-Aug-07 4:27
nayabsiddiqi27-Aug-07 4:27 
AnswerRe: how can i shut down my LAN? any idea Pin
Le centriste27-Aug-07 5:01
Le centriste27-Aug-07 5:01 
GeneralRe: how can i shut down my LAN? any idea Pin
nayabsiddiqi27-Aug-07 5:35
nayabsiddiqi27-Aug-07 5:35 
AnswerRe: how can i shut down my LAN? any idea Pin
Spacix One27-Aug-07 7:06
Spacix One27-Aug-07 7:06 
GeneralRe: how can i shut down my LAN? any idea Pin
nayabsiddiqi2-Oct-07 6:46
nayabsiddiqi2-Oct-07 6:46 
QuestionFieldBuilder question Pin
ma7moud_7elmy27-Aug-07 4:12
ma7moud_7elmy27-Aug-07 4:12 
QuestionData Transfer from .Net to VB6 application Pin
vs2428427-Aug-07 2:38
vs2428427-Aug-07 2:38 
AnswerRe: Data Transfer from .Net to VB6 application Pin
Leyu27-Aug-07 4:31
Leyu27-Aug-07 4:31 
GeneralRe: Data Transfer from .Net to VB6 application Pin
vs2428427-Aug-07 23:16
vs2428427-Aug-07 23:16 
AnswerRe: Data Transfer from .Net to VB6 application Pin
Justin Perez27-Aug-07 4:44
Justin Perez27-Aug-07 4:44 
GeneralRe: Data Transfer from .Net to VB6 application Pin
vs2428427-Aug-07 23:16
vs2428427-Aug-07 23:16 
Questionstart external app, but in a sync way Pin
blackjack215027-Aug-07 2:05
blackjack215027-Aug-07 2:05 
AnswerRe: start external app, but in a sync way Pin
Justin Perez27-Aug-07 2:13
Justin Perez27-Aug-07 2:13 
GeneralRe: start external app, but in a sync way Pin
blackjack215027-Aug-07 2:19
blackjack215027-Aug-07 2:19 
GeneralRe: start external app, but in a sync way Pin
Martin#27-Aug-07 2:32
Martin#27-Aug-07 2:32 
GeneralRe: start external app, but in a sync way Pin
Justin Perez27-Aug-07 2:39
Justin Perez27-Aug-07 2:39 
AnswerRe: start external app, but in a sync way Pin
Spacix One28-Aug-07 10:19
Spacix One28-Aug-07 10:19 
Questioninserting data into a label Pin
lourensG27-Aug-07 1:10
lourensG27-Aug-07 1:10 
AnswerRe: inserting data into a label Pin
Christian Graus27-Aug-07 1:34
protectorChristian Graus27-Aug-07 1:34 

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.