Click here to Skip to main content
16,005,080 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionWord Document Headers & Footers in .NET [modified] Pin
Nitin Varambally15-Jul-07 1:24
Nitin Varambally15-Jul-07 1:24 
Questionexports the dataset to excel using asp.net 2005 (vb.net) Pin
Sonia Gupta15-Jul-07 0:04
Sonia Gupta15-Jul-07 0:04 
AnswerRe: exports the dataset to excel using asp.net 2005 (vb.net) Pin
gauthee15-Jul-07 19:10
gauthee15-Jul-07 19:10 
Questionneed yr help for SqlDataSource1.Select method Pin
hurrem14-Jul-07 23:40
hurrem14-Jul-07 23:40 
AnswerRe: need yr help for SqlDataSource1.Select method Pin
gauthee15-Jul-07 18:46
gauthee15-Jul-07 18:46 
GeneralRe: need yr help for SqlDataSource1.Select method Pin
hurrem15-Jul-07 21:58
hurrem15-Jul-07 21:58 
AnswerRe: need yr help for SqlDataSource1.Select method Pin
arslanjatt15-Jul-07 18:52
arslanjatt15-Jul-07 18:52 
QuestionCode analysis [modified] Pin
ASPnoob14-Jul-07 20:37
ASPnoob14-Jul-07 20:37 
Hi, the following code is taken from a tutorial on reading blobs by Ganegoda.
Private Sub CreateImage(ByVal id As String)<br />
<br />
	Dim _con As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("DB"))<br />
<br />
	Try<br />
		_con.Open()<br />
		Dim _cmd As SqlCommand = _con.CreateCommand()<br />
		_cmd.CommandText = "select logo from" + " pub_info where pub_id='" + id + "'"<br />
		Dim _buf As Byte() = CByte(_cmd.ExecuteScalar())<br />
		Response.ContentType = "image/gif"<br />
		Response.BinaryWrite(_buf)<br />
	Catch<br />
	Finally<br />
		_con.Close()<br />
	End Try<br />
End Sub


I am new to vb.net and not very familiar with it. I have 2 questions regarding the code above.
1) Why is there a plus sign before and after id in the line where pub_id='" + id + "'"?
2) From reading the MSDN, _con.CreateCommand() is supposed to create a connection and return a SqlCommand object associated with the current connection. However I'm still not clear as to what that means. Is it the same as the following?
<br />
Dim _cmd As SqlCommand <br />
Dim Filter as String<br />
Filter = "select logo from" + " pub_info where pub_id='" + id + "'"<br />
_cmd = New SqlCommand(Filter, _con) <br />


Thanks in advance for your help.











-- modified at 4:04 Sunday 15th July, 2007
AnswerRe: Code analysis Pin
Guffa15-Jul-07 3:46
Guffa15-Jul-07 3:46 
AnswerRe: Code analysis Pin
Paul Conrad15-Jul-07 4:59
professionalPaul Conrad15-Jul-07 4:59 
AnswerRe: Code analysis Pin
Mohammed Hameed15-Jul-07 8:21
professionalMohammed Hameed15-Jul-07 8:21 
QuestionControls are not displaying after hosting the Page Pin
Kurian_Kurian14-Jul-07 14:23
Kurian_Kurian14-Jul-07 14:23 
AnswerRe: Controls are not displaying after hosting the Page Pin
Manas Bhardwaj14-Jul-07 22:36
professionalManas Bhardwaj14-Jul-07 22:36 
AnswerRe: Controls are not displaying after hosting the Page Pin
Guffa14-Jul-07 23:02
Guffa14-Jul-07 23:02 
GeneralRe: Controls are not displaying after hosting the Page Pin
Kurian_Kurian14-Jul-07 23:29
Kurian_Kurian14-Jul-07 23:29 
AnswerRe: Controls are not displaying after hosting the Page Pin
Guffa15-Jul-07 0:34
Guffa15-Jul-07 0:34 
GeneralRe: Controls are not displaying after hosting the Page Pin
Sonia Gupta15-Jul-07 0:58
Sonia Gupta15-Jul-07 0:58 
GeneralRe: Controls are not displaying after hosting the Page Pin
Guffa15-Jul-07 15:15
Guffa15-Jul-07 15:15 
GeneralRe: Controls are not displaying after hosting the Page Pin
Sonia Gupta15-Jul-07 19:05
Sonia Gupta15-Jul-07 19:05 
QuestionRequire help getting started s'il vous plait! Pin
gvanto14-Jul-07 14:20
gvanto14-Jul-07 14:20 
AnswerRe: Require help getting started s'il vous plait! Pin
just3ala215-Jul-07 6:07
just3ala215-Jul-07 6:07 
GeneralRe: Require help getting started s'il vous plait! Pin
Pete O'Hanlon15-Jul-07 10:01
mvePete O'Hanlon15-Jul-07 10:01 
GeneralRe: Require help getting started s'il vous plait! Pin
just3ala215-Jul-07 21:20
just3ala215-Jul-07 21:20 
AnswerRe: Require help getting started s'il vous plait! Pin
Pete O'Hanlon15-Jul-07 10:21
mvePete O'Hanlon15-Jul-07 10:21 
AnswerRe: Require help getting started s'il vous plait! Pin
neerubee15-Jul-07 19:37
neerubee15-Jul-07 19:37 

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.