Click here to Skip to main content
15,889,462 members
Home / Discussions / Database
   

Database

 
AnswerRe: sybase version 6 Pin
Mycroft Holmes5-Dec-08 14:48
professionalMycroft Holmes5-Dec-08 14:48 
QuestionUsing DataTable.Select in the slickest way possible Pin
jesarg5-Dec-08 6:55
jesarg5-Dec-08 6:55 
AnswerRe: Using DataTable.Select in the slickest way possible Pin
Wendelius5-Dec-08 7:16
mentorWendelius5-Dec-08 7:16 
QuestionUgly group by problem Pin
gantww5-Dec-08 5:40
gantww5-Dec-08 5:40 
AnswerRe: Ugly group by problem Pin
Ben Fair5-Dec-08 5:54
Ben Fair5-Dec-08 5:54 
Questionretrieve from 3 table Pin
benjamin yap5-Dec-08 4:38
benjamin yap5-Dec-08 4:38 
AnswerRe: retrieve from 3 table Pin
Ben Fair5-Dec-08 5:38
Ben Fair5-Dec-08 5:38 
QuestionHow can I insert a record into a table in SQLCE? Pin
JUNEYT5-Dec-08 0:10
JUNEYT5-Dec-08 0:10 
Hi,

I performed a search in google and found different answers to my question. However none of them did work out. I am able to read from a table but when I try to insert into a table, it doesn't insert and it doesn't give me any error message. I am using SQLCE in Windows Mobile 6.1 OS. If you give me a working sample for INSERT statment in SQLCE, I would really appreciate it.

The code below neither does insert the record into table nor produce any error.

Dim myconnection As New SqlCeConnection(ConnStr)
Dim mycommand As New SqlCeCommand
Dim InsertStr As String = Nothing

mycommand.CommandType = CommandType.Text
mycommand.Connection = myconnection

Dim xdate As Date = DateTimePicker1.Value
xdate = xdate.ToShortDateString


InsertStr = "INSERT INTO Expenses ([Date],BelongTo,Status,ExpenseAmount,ExpenseCurrency) "
InsertStr += "VALUES ('" & xdate & "'," & ExpenseIndex & ",0," & CType(ExpenseAmount.Text, Decimal) & "," & "'" & Currency.SelectedItem.ToString & "');"

mycommand.CommandText = InsertStr

Try
    mycommand.Connection.Open()
    mycommand.ExecuteNonQuery()

Catch ex As Exception
    MsgBox(ex.ToString & vbCrLf & InsertStr)
    mycommand.Connection.Close()
    Exit Sub
End Try

mycommand.Connection.Close()



What a curious mind needs to discover knowledge is noting else than a pin-hole.


AnswerRe: How can I insert a record into a table in SQLCE? Pin
Wendelius5-Dec-08 7:38
mentorWendelius5-Dec-08 7:38 
Questionsql server 2008 Filestream Pin
lambo4-Dec-08 21:19
lambo4-Dec-08 21:19 
AnswerRe: sql server 2008 Filestream Pin
Mycroft Holmes4-Dec-08 21:32
professionalMycroft Holmes4-Dec-08 21:32 
GeneralRe: sql server 2008 Filestream Pin
Paddy Boyd5-Dec-08 0:42
Paddy Boyd5-Dec-08 0:42 
QuestionVLDB optimization Pin
sujithkumarsl4-Dec-08 20:00
sujithkumarsl4-Dec-08 20:00 
AnswerRe: VLDB optimization Pin
Ashfield4-Dec-08 21:02
Ashfield4-Dec-08 21:02 
GeneralRe: VLDB optimization Pin
sujithkumarsl4-Dec-08 21:05
sujithkumarsl4-Dec-08 21:05 
GeneralRe: VLDB optimization Pin
Ashfield5-Dec-08 1:14
Ashfield5-Dec-08 1:14 
AnswerRe: VLDB optimization Pin
Mycroft Holmes4-Dec-08 21:39
professionalMycroft Holmes4-Dec-08 21:39 
AnswerRe: VLDB optimization Pin
Wendelius5-Dec-08 7:31
mentorWendelius5-Dec-08 7:31 
GeneralRe: VLDB optimization Pin
sujithkumarsl8-Dec-08 17:29
sujithkumarsl8-Dec-08 17:29 
GeneralRe: VLDB optimization Pin
Wendelius9-Dec-08 7:40
mentorWendelius9-Dec-08 7:40 
GeneralRe: VLDB optimization Pin
sujithkumarsl9-Dec-08 16:51
sujithkumarsl9-Dec-08 16:51 
GeneralRe: VLDB optimization Pin
Wendelius10-Dec-08 4:41
mentorWendelius10-Dec-08 4:41 
QuestionHow can I optimize this SQL Query? Pin
Rafferty Uy4-Dec-08 17:52
Rafferty Uy4-Dec-08 17:52 
AnswerRe: How can I optimize this SQL Query? Pin
Wendelius4-Dec-08 19:38
mentorWendelius4-Dec-08 19:38 
GeneralRe: How can I optimize this SQL Query? Pin
Rafferty Uy4-Dec-08 20:10
Rafferty Uy4-Dec-08 20:10 

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.