|
You need to have the folder must be part of the website in IIS. If it is then a link to file should work.
I didn't get any requirements for the signature
|
|
|
|
|
Is this what you're talking about?
http://image.bayimg.com/ia/dl/ia/ab/g.jpg
Also, thanks for the reply!
|
|
|
|
|
Yeah, just set that as the navURL or whatever the property is of the ASP Hyperlink control.
I didn't get any requirements for the signature
|
|
|
|
|
Hi, I've used a for-next loop to determine the item(s) of a listbox that the user selects and to insert the text of the selected item(s) into a database table like the following.
For i = 0 To ListBox1.Items.Count - 1<br />
If ListBox1.Items(i).Selected Then<br />
cmdInsert.Parameters.Add("@docDate", OdbcType.Date)<br />
cmdInsert.Parameters("@docDate").Value = DateTime.Now<br />
<br />
cmdInsert.Parameters.Add("@docTitle", OdbcType.VarChar, 30)<br />
cmdInsert.Parameters("@docTitle").Value = txtFileTitle.Text<br />
<br />
cmdInsert.Parameters.Add("@docType", OdbcType.VarChar, 30)<br />
cmdInsert.Parameters("@docType").Value = StrFileType<br />
<br />
cmdInsert.Parameters.Add("@docContent", OdbcType.Binary, 800)<br />
cmdInsert.Parameters("@docContent").Value = arrFile<br />
<br />
cmdInsert.Parameters.Add("@Professions", OdbcType.VarChar, 30)<br />
cmdInsert.Parameters("@Professions").Value = ListBox1.Items(i).Text<br />
<br />
End If<br />
Next<br />
The problem I'm getting is that if two items were selected, only the 2nd item is inserted. Please take a look to see what I did wrong, thank you in advance for your help.
|
|
|
|
|
Well, you need to put
conn.open<br />
cmdInsert.executenonquery<br />
conn.close
inside your loop, otherwise you are only inserting one record.
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
If anyone can walk me through or at least give an example of how i can tackle this problem i will be very grateful.
Basically i am trying to create a log-in for a website in .Net 2.0 using SQL2005. Using a DataReader (using controls in VS2005) i have the datareader check for the occurance of a matching record based on username and password.
However i need to make sure only one matching record is found and then get all this users data adplace it into a cookie or session, and update the page accordingly.
How do i check only one matching record is found?
Please dont direct me to some complicated lengthy Microsoft solution page as i never find these to be helpful. I could really do with someone explaining this to me as best as possible.
Thanks in advance.
mike
|
|
|
|
|
Dear mike,
you can use the following method.
dim connnstring as string
connectionstring=" you have to put your connection string here"
it is like provider=microsoft.oledbprovider.......
dim conn as new sqlconnection(connectionstring)
conn.open
dim querystring as string
querystring="Select Username,Passowrd from userTable"
You have to put your table name and columns there
dim cmd as new sqlcommand(querystring,conn)
dim reader as new sqldatareader=cmd.executereader
while reader.read
if reader(0)=UserName and reader(1)=PassWord Then
Session("UserName")=UserName
End if
end while
reader.close
conn.close
All The Best
Sathesh Pandian
|
|
|
|
|
sathesh_pandian wrote: while reader.read
And how does this limit it to one record being returned from the database?
sathesh_pandian wrote: if reader(0)=UserName and reader(1)=PassWord Then
Very poor technique.
only two letters away from being an asset
|
|
|
|
|
Have you considered using the asp.net membership stuff? There are login controls that you can use. There is a sql script that needs to be run that will create all of the tables stored procedures etc. in your sql database. I think it would make a lot of sense to use something that works verses trying to write it your self. You could also use the Profile object to store stuff you might normally store in a cookie.
I know you said you don't want links, but you have to start somewhere:
http://msdn2.microsoft.com/en-us/library/yh26yfzy.aspx[^]
This one is one profile:
http://msdn2.microsoft.com/en-us/library/d8b58y5d.aspx[^]
Ben
|
|
|
|
|
As kubben replied uisng the builtin membership provider stuff is easy and will take care of this problem.
However if you need to authenticate against a custome database then just check the number of records returned.
DataTable dt = Authenticate(username, password);<br />
if( dt.rows.count > 1 )<br />
return false;<br />
else<br />
return true;
only two letters away from being an asset
|
|
|
|
|
Hi,
I have a datatable filled with data I get from a sql query and database. Has the following columns in:
EmployeeID
EmployeeName
EmployeeSurname
EmployeeSickLeaveDate
I just want to select all the data from column "EmployeeName" in the datatable. By that, I only want to populate a new datatable with "EmployeeName"
How will this be possible. I tried using datatable.select(), but no luck, or I am not using it correct.
|
|
|
|
|
I would try this:
I am assuming you are using vb.net
Dim dt DataTable = firstDataTable.Clone()
'This removes EmployeeID
dt.Columns.RemoveAt(0)
'This removes EmployeeSurname
dt.Columns.RemoveAt(1)
'This removes EmployeeSickLeaveDate
dt.Columns.RemoveAt(1)
So now you have a new dataTable with only one column.
Hope that helps.
Ben
|
|
|
|
|
Thank you Ben,
I think this method will help me a lot. Will try it over the weekend.
Regards
Playout
|
|
|
|
|
Provided of course that the ordinal of the columns doesn't change.
This is a bit brute force and not really necessary.
only two letters away from being an asset
|
|
|
|
|
First way would be to have the database query return only the column you are looking for.
Otherwise try this
DataTable EmployeeName = new DataTable();<br />
EmployeeName.Columns.Add("EmployeeName");<br />
EmployeeName.Merge(fullDataTable);
only two letters away from being an asset
|
|
|
|
|
Hi everybody.
Currently i'm developing a system in Visual Basic .NET under 1.1 Framework, that requires add a couple of webcontrols (mainly Buttons), and i need these controls to respond to events, like the Click one. Is very easy to do this to a control added to a project on design time. But if i want to add buttons on execution time, and that every button responds to a click doing something (something simple like raise a javascript message, or delete a database record) i get confused.
I tried using Button.Attributes.Add("onclick", "something-to-do") but this approach is not working at all.
I really apreciate if someone knows how to do this.
Kind regards,
Leistath.
"I hated myself... no, I hated my place in the world" - From Jerry Maguire
|
|
|
|
|
In vb.net use
<br />
'After you create your control<br />
AddHandler Button1.Click, AddressOf Button1_Click<br />
<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) <br />
<br />
'put your code here, it should fire on postback<br />
End Sub
I didn't get any requirements for the signature
|
|
|
|
|
Thank you ToddHileHoffer. I followed your suggestion and i get working this now. I really appreciate your help mate.
Regards,
leistath
"I hated myself... no, I hated my place in the world" - From Jerry Maguire
|
|
|
|
|
hi,
its Asp.net discussion forum. i think you are trying to use the asp.net method in the
vb.net.
you have to add some handlers for this.
eg.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler Me.Click, AddressOf form_click
End Sub
Sub form_click(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
This handler will be called when the form has been clicked.
Try this type and you can remove it
through
removehandler Me.Click, AddressOf form_click
All The Best
Sathesh Pandian
|
|
|
|
|
Thanks Sathesh, i've understood how this works. Thank you so much.
"My pain is constant and sharp...and i do not hope for better world for anyone. In fact, i want my pain to be inflicted on others..." - Children Of Bodom - Bodom Beach Terror
|
|
|
|
|
Hi all,
Some time before I was struggling with Page break. now I found the method for page break nad still finding to add columns headers after 15 rows.
I am using the following script to set up the page break after printing 15 items in a page. It is working all right. Is there any other way to insert page break after certain page margin?
protected void GVMaterialMovement_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
count++;
if(count > 15)
{
e.Row.Style.Add("page-break-after", "always");
count = 0;
}
}
}
Is there any similar way to add header after each 15 Records?
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Hi there.
I am uploading images to my website and them writeing it into a DB. I want to do validation on the image that i upload. At the moment i am checking the size(bytes) of the image. what i also need to do, is check the Physical lenght of the image.
Can anyone help me with this?
Thanks
|
|
|
|
|
if(fileUpload1.HasFile == true)
{
blah blah...
}
Hope it helps
|
|
|
|
|
Try this.
<br />
<script runat="server"><br />
Sub submit(Sender as Object, e as EventArgs)<br />
fname.InnerHtml=MyFile.PostedFile.FileName<br />
clength.InnerHtml=MyFile.PostedFile.ContentLength<br />
End Sub<br />
</script><br />
<br />
<html><br />
<body><br />
<br />
<form id="Form1" method="post"<br />
enctype="multipart/form-data" runat="server"><br />
<p><br />
Select file to upload to server:<br />
<input id="MyFile" type="file" size="40" runat="server"> <br />
</p><br />
<p><br />
<input id="Submit1" type="submit" value="Upload!" OnServerclick="submit"<br />
runat="server"><br />
</p><br />
<p><br />
<div id="Div1" runat="server"><br />
FileName: <span id="fname" runat="server"/><br /><br />
ContentLength: <span id="clength" runat="server"/> bytes<br />
</div><br />
</p><br />
</form><br />
<br />
</body><br />
</html> <br />
<br />
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Can any one please tell me how to display messagebox on a button click using a server control.
Thanks in advance
|
|
|
|