Click here to Skip to main content
16,006,442 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Encryption and Decryption of username and password in asp.net Pin
amin_behzadi13-Jun-07 20:22
professionalamin_behzadi13-Jun-07 20:22 
QuestionCheckedBoxList Pin
Rajiya13-Jun-07 18:59
Rajiya13-Jun-07 18:59 
AnswerRe: CheckedBoxList Pin
Chetan Ranpariya13-Jun-07 20:38
Chetan Ranpariya13-Jun-07 20:38 
AnswerRe: CheckedBoxList Pin
saravraj13-Jun-07 21:21
saravraj13-Jun-07 21:21 
QuestionSystem.IndexOutOfRangeException: There is no row at position 0 Pin
Sophia Rekhi13-Jun-07 18:58
Sophia Rekhi13-Jun-07 18:58 
AnswerRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Venkatesh Mookkan13-Jun-07 19:41
Venkatesh Mookkan13-Jun-07 19:41 
GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Sophia Rekhi13-Jun-07 19:56
Sophia Rekhi13-Jun-07 19:56 
GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Venkatesh Mookkan13-Jun-07 20:05
Venkatesh Mookkan13-Jun-07 20:05 
Sophia Rekhi wrote:
Dim da As New SqlDataAdapter("Select * From pub_info ", con)
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ds As New DataSet

da.MissingSchemaAction = MissingSchemaAction.AddWithKey
con.Open()
da.Fill(ds, "pub_info")
Dim fn As String = System.IO.Path.GetFullPath(File1.PostedFile.FileName)
Dim fs As New FileStream(fn, FileMode.OpenOrCreate, FileAccess.Read)
Dim MyData(fs.Length) As Byte
Dim sql As String
fs.Read(MyData, 0, fs.Length)
fs.Close()
ds.Tables("pub_info").Rows(0)("logo") = MyData
da.Update(ds, "pub_info")


Change as below,

Dim da As New SqlDataAdapter("Select * From pub_info ", con)
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ds As New DataSet

da.MissingSchemaAction = MissingSchemaAction.AddWithKey
con.Open()
da.Fill(ds, "pub_info")
Dim fn As String = System.IO.Path.GetFullPath(File1.PostedFile.FileName)
Dim fs As New FileStream(fn, FileMode.OpenOrCreate, FileAccess.Read)
Dim MyData(fs.Length) As Byte
Dim sql As String
fs.Read(MyData, 0, fs.Length)
fs.Close()
If ds.Tables("pub_info").Rows.Count=0 Then
    Dim DR As DataRow = ds.Tables("pub_info").NewRow()
    ds.Tables("pub_info").Rows.Add(DR)
End If
ds.Tables("pub_info").Rows(0)("logo") = MyData
da.Update(ds, "pub_info")



I think this would solve your problem.


Regards,
Venkatesh Mookkan.
Software Engineer, India
My: Website | Yahoo Group | Blog Spot

GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Sophia Rekhi13-Jun-07 20:30
Sophia Rekhi13-Jun-07 20:30 
GeneralRe: System.IndexOutOfRangeException: There is no row at position 0 Pin
Venkatesh Mookkan13-Jun-07 20:41
Venkatesh Mookkan13-Jun-07 20:41 
Questionencrypt the coookies Pin
saravanan0513-Jun-07 18:13
saravanan0513-Jun-07 18:13 
AnswerRe: encrypt the coookies Pin
Sylvester george13-Jun-07 18:28
Sylvester george13-Jun-07 18:28 
QuestionRe: encrypt the coookies Pin
saravanan0513-Jun-07 19:11
saravanan0513-Jun-07 19:11 
AnswerRe: encrypt the coookies Pin
Sylvester george13-Jun-07 19:24
Sylvester george13-Jun-07 19:24 
GeneralRe: encrypt the coookies Pin
saravanan0513-Jun-07 20:08
saravanan0513-Jun-07 20:08 
AnswerRe: encrypt the coookies Pin
Sathesh Sakthivel13-Jun-07 19:29
Sathesh Sakthivel13-Jun-07 19:29 
GeneralRe: encrypt the coookies Pin
saravanan0513-Jun-07 20:09
saravanan0513-Jun-07 20:09 
GeneralRe: encrypt the coookies Pin
Sathesh Sakthivel13-Jun-07 20:13
Sathesh Sakthivel13-Jun-07 20:13 
QuestionRe: encrypt the coookies Pin
saravanan0513-Jun-07 20:26
saravanan0513-Jun-07 20:26 
AnswerRe: encrypt the coookies Pin
Sathesh Sakthivel13-Jun-07 20:30
Sathesh Sakthivel13-Jun-07 20:30 
GeneralRe: encrypt the coookies Pin
saravanan0513-Jun-07 20:34
saravanan0513-Jun-07 20:34 
GeneralRe: encrypt the coookies Pin
Sathesh Sakthivel13-Jun-07 20:37
Sathesh Sakthivel13-Jun-07 20:37 
GeneralRe: encrypt the coookies Pin
saravanan0513-Jun-07 20:41
saravanan0513-Jun-07 20:41 
GeneralRe: encrypt the coookies Pin
Sylvester george13-Jun-07 20:45
Sylvester george13-Jun-07 20:45 
GeneralRe: encrypt the coookies Pin
saravanan0513-Jun-07 20:51
saravanan0513-Jun-07 20:51 

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.