hi there
got a question regarding sqlserver ,
well i m currently writing a program in vb.net and when i have run debug i manage to added the data but in reality it did not added to database in sqlserver ... i m currently using nt integrated security log on ... when i execute store procedure in server explorer alone, the data added to database but when writing a vb it doesnt dont know why ? this is my code for the program
Readap.InsertCommand.CommandType = CommandType.StoredProcedure
Readap.InsertCommand.Parameters.Add("@ReligionName", SqlDbType.NVarChar, 20, "ReligionName")
Dim myParm As SqlParameter = Readap.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 4, "ReligionID")
''set to out put
myParm.Direction = ParameterDirection.Output
'TextBox1.Text = myParm.Value
Dim catDS As DataSet = New DataSet
catDS.Locale = New System.Globalization.CultureInfo("th-TH")
con2.Open()
Readap.Fill(catDS, "ReligionType")
Dim newRow As DataRow = catDS.Tables("ReligionType").NewRow()
newRow("ReligionName") = inputdata.Text
'newRow("ReligionID") = 1
'add new stuff
catDS.Tables("ReligionType").Rows.Add(newRow)
catDS.AcceptChanges()
Readap.Update(catDS, "ReligionType")
con2.Close()
please someone have a look and tell me what is the cause of this
many thanks
sun
got a question regarding sqlserver ,
well i m currently writing a program in vb.net and when i have run debug i manage to added the data but in reality it did not added to database in sqlserver ... i m currently using nt integrated security log on ... when i execute store procedure in server explorer alone, the data added to database but when writing a vb it doesnt dont know why ? this is my code for the program
Readap.InsertCommand.CommandType = CommandType.StoredProcedure
Readap.InsertCommand.Parameters.Add("@ReligionName", SqlDbType.NVarChar, 20, "ReligionName")
Dim myParm As SqlParameter = Readap.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 4, "ReligionID")
''set to out put
myParm.Direction = ParameterDirection.Output
'TextBox1.Text = myParm.Value
Dim catDS As DataSet = New DataSet
catDS.Locale = New System.Globalization.CultureInfo("th-TH")
con2.Open()
Readap.Fill(catDS, "ReligionType")
Dim newRow As DataRow = catDS.Tables("ReligionType").NewRow()
newRow("ReligionName") = inputdata.Text
'newRow("ReligionID") = 1
'add new stuff
catDS.Tables("ReligionType").Rows.Add(newRow)
catDS.AcceptChanges()
Readap.Update(catDS, "ReligionType")
con2.Close()
please someone have a look and tell me what is the cause of this
many thanks
sun