Click here to Skip to main content
15,887,267 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
JokeRe: ARCGIS, Please help!! It's urgent Pin
vasanth111122-Jun-09 0:53
vasanth111122-Jun-09 0:53 
GeneralExport DataList into Excel with exact text,position and style in asp.net Pin
compaq750018-Jun-09 2:10
compaq750018-Jun-09 2:10 
GeneralRe: Export DataList into Excel with exact text,position and style in asp.net Pin
jinal shah30-Jun-09 21:04
jinal shah30-Jun-09 21:04 
GeneralRe: Export DataList into Excel with exact text,position and style in asp.net Pin
Member 20063269-Dec-09 20:04
Member 20063269-Dec-09 20:04 
QuestionWindows always on top? Pin
marca29218-Jun-09 1:53
marca29218-Jun-09 1:53 
AnswerRe: Windows always on top? Pin
Luc Pattyn18-Jun-09 2:06
sitebuilderLuc Pattyn18-Jun-09 2:06 
GeneralRe: Windows always on top? Pin
marca29218-Jun-09 2:20
marca29218-Jun-09 2:20 
Question"Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
ChiSmile17-Jun-09 23:05
ChiSmile17-Jun-09 23:05 
Hello there!
My code is highlighted below.I have five tabpages(two is shown here!) on a form called vwpatient that runs each time a tabpage is selected.The code below works but my problem is this: there is a textbox called sachPatient.patID from another form called sachPatient, the code pulls data from the database on clicking one or two pages, but if more than two is clicked, an exception fires saying "Make sure you have not released a resource before attempting to use it". I have tried endlessly to fix this problem to no avail. And am still trying!!.
I would appreciate if someone can help me.
Thanks in advance!!!




Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged


For Each tabcont As Control In Me.Controls
If TypeOf tabcont Is TabControl Then
For Each tp As Control In tabcont.Controls
If TypeOf tp Is TabPage Then
Select Case tp.Name
Case "vwProfTabPg"

Try

LoadData()
' Configure and execute the command.
cmd = New System.Data.SqlClient.SqlCommand("SELECT * FROM Patient_profile where patient_Id = @Pat_ID")
cmd.Connection = cn
Dim paraPatId As SqlParameter = cmd.Parameters.Add("@Pat_ID", sachPatient.patID.Text)
' Load the DataTable.
datadapt = New System.Data.SqlClient.SqlDataAdapter(cmd)
datadapt.Fill(ds)
ds.Tables.Add(dt)

' Bind the DataGrid.

vwProfDG.DataSource = ds.Tables(0)
vwProfDG.Visible = True

Catch ex As SqlException
MsgBox(ex.Message.ToString())
Finally
cn.Close()
End Try

Case "vwLabTabPg"
Try

LoadData()

' Configure and execute the command.
cmd = New System.Data.SqlClient.SqlCommand("SELECT * FROM lab where patient_Id = @PatLa_ID")
cmd.Connection = cn
Dim paraPatId As SqlParameter = cmd.Parameters.Add("@PatLa_ID", sachPatient.patID.Text)
' Load the DataTable.
datadapt = New System.Data.SqlClient.SqlDataAdapter(cmd)
datadapt.Fill(ds)
ds.Tables.Add(dt)

' Bind the DataGrid.

vwLabDatGrid.DataSource = ds.Tables(0)
vwLabDatGrid.Visible = True

Catch ex As SqlException
MsgBox(ex.Message.ToString())
Finally
cn.Close()
End Try
End Select
End If
Next
End If
Next
AnswerRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
0x3c017-Jun-09 23:42
0x3c017-Jun-09 23:42 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
ChiSmile18-Jun-09 1:58
ChiSmile18-Jun-09 1:58 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
Luc Pattyn18-Jun-09 2:08
sitebuilderLuc Pattyn18-Jun-09 2:08 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
ChiSmile18-Jun-09 4:11
ChiSmile18-Jun-09 4:11 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
Luc Pattyn18-Jun-09 4:33
sitebuilderLuc Pattyn18-Jun-09 4:33 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
Pete O'Hanlon18-Jun-09 2:23
mvePete O'Hanlon18-Jun-09 2:23 
GeneralRe: "Make sure you have not released a resource before attempting to use it". HELP!!!! Pin
led mike19-Jun-09 5:28
led mike19-Jun-09 5:28 
QuestionCreating primary key constraints on a table using VB.NET Pin
sivakumar.mariappan17-Jun-09 21:05
sivakumar.mariappan17-Jun-09 21:05 
AnswerRe: Please Ignore [Cross Post] Pin
Aman Bhullar18-Jun-09 2:37
Aman Bhullar18-Jun-09 2:37 
QuestionHow many primary key constraints can we have in a table of ms-access? Pin
sivakumar.mariappan17-Jun-09 20:57
sivakumar.mariappan17-Jun-09 20:57 
AnswerRe: How many primary key constraints can we have in a table of ms-access? Pin
Colin Angus Mackay17-Jun-09 22:58
Colin Angus Mackay17-Jun-09 22:58 
AnswerRe: How many primary key constraints can we have in a table of ms-access? Pin
DoctorMick18-Jun-09 1:11
DoctorMick18-Jun-09 1:11 
QuestionHow Do I Print a file with Epson T88IV quickly? [modified] Pin
Member 239059517-Jun-09 18:53
Member 239059517-Jun-09 18:53 
AnswerRe: How Do I Print a file with Epson T88IV quickly? Pin
Aman Bhullar18-Jun-09 2:42
Aman Bhullar18-Jun-09 2:42 
GeneralRe: How Do I Print a file with Epson T88IV quickly? Pin
Member 239059518-Jun-09 22:49
Member 239059518-Jun-09 22:49 
GeneralRe: How Do I Print a file with Epson T88IV quickly? Pin
Aman Bhullar19-Jun-09 6:18
Aman Bhullar19-Jun-09 6:18 
Question.Net Date Compare Pin
Tristan Rhodes17-Jun-09 3:28
Tristan Rhodes17-Jun-09 3:28 

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.