Here is my code to create a link between an image and a CD:
Private Sub AddImageToCD(ByVal cdID As Integer, ByVal imgID As
Integer)
Dim DBConnection As New
SqlConnection(ConfigurationManager.ConnectionStrings("myServer").ConnectionString)
Dim searchImgSQL As String = "SELECT CDName FROM ImagesInCDs
INNER JOIN CDsCollection ON ImagesInCDs.cdcID = CDsCollection.cdcID
WHERE ImagesInCDs.imgID = @imgID"
Dim searchImgCMD As New SqlCommand(searchImgSQL, DBConnection)
searchImgCMD.Parameters.Add(New SqlParameter("@imgID",
SqlDbType.Int))
searchImgCMD.Parameters("@imgID").Value = imgID
Dim dTable As New DataTable
Dim adapter As New SqlDataAdapter(searchImgCMD)
adapter.Fill(dTable)
If dTable.Rows.Count = 0 Then
InsertLink(cdID, imgID)
AddWarningMsgDiv.Visible = False
Else
'Here is we I need to include the popup alert message. For now, I’m
diplaying a label and two buttons: Yes and No
AddWarningMsgDiv.Visible = True
Dim listOfCDs As String = "This image is in the following
CD(s):</ br>"
For Each row As DataRow In dTable.Rows
listOfCDs = listOfCDs & row("CDName") & "</ br>"
Next
End If
End Sub
On Apr 13, 3:48 pm, "Keidrick Pettaway" <[email protected]> wrote:
> Can you post what code you thus far?
> Keidrick Pettaway
> Web:http://www.kpettaway.com
> Linkedin:http://www.linkedin.com/pub/keidrick-pettaway/8/705/b58
>
>
>
>
>
> -----Original Message-----
> From: Ana <[email protected]>
> Date: Tue, 13 Apr 2010 14:45:17
> To: DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
> Services,.NET Remoting<[email protected]>
> Subject: [DotNetDevelopment] Re: Pop up javascript alert in VB.NET code
>
> Thanks for you reply, Keidrick!
>
> Could you give me any hints? WhatI found on google or was directly
> associated to a button (I mean, as soon as the user clicks on the
> button the message is displayed, without checking any code in the code
> behind. Something like: thuButtom.Attributes.Add("onclick","...")) or
> was code to display a popup message without giving the user the option
> to proceed or cancel.
>
> In more details what I'm doing is: when the user clicks on the Insert
> Button, a routine for inserting an image in a CD is called inside the
> click event for the button. While inserting, I have to make the
> following test: If the image is in some CD on the database, I need to
> display the message asking the user if he is sure he wants to insert
> the image, even if the image is already in another CD (to make sure
> the user know that, if he proceeds, the same image will be in more
> than one CD). The user will need to have two options: proceed with the
> insertion or cancel the insertion.
>
> Any tips?
>
> On Apr 13, 3:26 pm, "Keidrick Pettaway" <[email protected]> wrote:
> > It is very possible. I recommend google or codeproject to get started.
> > Keidrick Pettaway
> > Web:http://www.kpettaway.com
> > Linkedin:http://www.linkedin.com/pub/keidrick-pettaway/8/705/b58
>
> > -----Original Message-----
> > From: Ana <[email protected]>
> > Date: Tue, 13 Apr 2010 14:23:43
> > To: DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
> > Services,.NET Remoting<[email protected]>
> > Subject: [DotNetDevelopment] Pop up javascript alert in VB.NET code
>
> > Hi,
>
> > In my page I need to pop up a javascript alert message that allows the
> > user to proceed or cancel the operation. It would be something like
> > this:
>
> > Protected Sub theButton_Click(...) Handles thButtons.Click
> > If (all conditions are ok)
> > proceed
> > else
> > popup javascript: "Are you sure you want to continue?"
> > 'if user wants to continue, proceed
> > 'if user cancels the operation, leave Sub
> > End Sub
>
> > Is this something possible?
>
> > Thanks,
>
> > Ana
>
> > --
> > To unsubscribe, reply using "remove me" as the subject.