|
The confusion is that I have just started programming...and I'm not very experienced.
I created a web site were I presenting data from a database with gridviews and datalists. The only update command I need is this botton.
My thought:
I need an event lets say "OnClick" and a Sub that corresponds to onclick event has the db connection, "checking code" and the SQL code to update the record.
Am I right?
Thank you for your reply...
|
|
|
|
|
Hi,
I have this datagrid that inserts data and I want to know who ever has inserted data through his login name when starting computer. How could I do this? I have tried Windows Authentication but it does not work?
I've added Authentication Mode="windows", identity impersonate="true", and The IIS I've Unchecked: Anonymous access and Checked: Intergrated Windows authentication. But no change is being made.
Thanks.
|
|
|
|
|
nclauder wrote: I have this datagrid
Which ?
|
|
|
|
|
A datagrid that inserts data. I mean using edit,Update and cancel. It actually inserts data into SQlserver. But the inserting code is not the problem, my problem is I want to know Which ever user has inserted data. Like when some one login his computer and uses the datagrid I want the user name to be automatically in datagrid.
Thanks
|
|
|
|
|
hi friends
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NEW\ASPNET'.
i got above error on when i run the my ASP.NET applicaion.
plz give me the solution
regards
saravanan
|
|
|
|
|
It looks like you are trying to use integrated security, but haven't added the ASPNET user as a user in the database.
---
single minded; short sighted; long gone;
|
|
|
|
|
saravanan05 wrote: Login failed for user 'NEW\ASPNET'.
Show me your connection string
|
|
|
|
|
Hi all,
I have a problem as follow.
I have a file/folder tree in my CMS - web site. this tree shows all the name of file and folder existing for a web site in tree view.
The list of names in this tree view list is coming from a XML file, and the real location of every file is saved in database.
So what i need to do is to make such functionality , that i could move the folders and files in this tree anywhere.
For this i need to first make changes in xml file from where the filename list is coming in tree view. and also i need to update the location for related file in database.
Could any one help me to develop such functionality.
|
|
|
|
|
I am adding three buttons for every new question. suppose i have two questions then i have two pairs of three buttons all having different ids.
If i click the first button then i want the id of this button and if i click the second button i want his id.And i have this function which i am calling in the form load event.In this function i am adding controls at runtime.Is this ok.It is very urgent.
Mohinder Singh
|
|
|
|
|
vengaqua wrote: f i click the first button then i want the id of this button and if i click the second button i want his id
You can use button.clientId
vengaqua wrote: And i have this function which i am calling in the form load event
Which function ? I m not seeing anything
|
|
|
|
|
i have a function that adds the controls at runtime and i generate their ids at that time.And i am calling this function in the form load event. outside that function i dont have access to the buttons. Now tell me how to do it.i want the id of the button i click.I need this thing very urgently.Please hel me dear.
Mohinder Singh
|
|
|
|
|
Hi everybody. Anyone help me.
I have a table in SQL 2000 with one of the colume is image data. But when I load this column to my Datagrid (in VB.Net, ASP.Net), I don't know how my Datagrid show the picture i inserted.
If someone know how to do this, Please help me. Thanks too much.
My email is: aeriscute@yahoo.com
Hanh Aeriscute
|
|
|
|
|
take new page page called image.aspx and write below code in its codebehind page.
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
MemoryStream stream = new MemoryStream();<br />
SqlConnection connection = new<br />
SqlConnection(@"server=servername;database=DBname;uid=sa;pwd=ccc");<br />
try<br />
{<br />
connection.Open();<br />
SqlCommand command = new<br />
SqlCommand("select image_name from image", connection);<br />
byte[] image = (byte[])command.ExecuteScalar();<br />
stream.Write(image, 0, image.Length);<br />
Bitmap bitmap = new Bitmap(stream);<br />
Response.ContentType = "image/gif";<br />
bitmap.Save(Response.OutputStream, ImageFormat.Gif);<br />
bitmaps.Dispose();<br />
}<br />
finally<br />
{<br />
connection.Close();<br />
stream.Close();<br />
}<br />
}
Now in ur datagrid page just set src or imageurl of this page like this.
<datagrid id="" ...........="">
<columns>
<asp:templatefield>
<itemtemplate>
Best regards
Pathan
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
try this:
http://aspalliance.com/articleViewer.aspx?aId=141&pId=
|
|
|
|
|
Here is this: http://www.codeproject.com/aspnet/CPImageGallery.asp[^]
It doesn't show the part about dumping it into a datagrid but I believe that is the easier of the tasks involved. It's a fully functioning application and you should readily be able to customize it.
|
|
|
|
|
Respected Gurus
I want to make a calendar through javascript.
it should not be any third party control because it may create problem when i will upload my project on the server.
It should not be machine dependent.
plz give me some code......
or any link where i can get some code....
Any solution
Ajay
|
|
|
|
|
U can search for any Javascript calender control u will get many js files which u can use.If u didnt get then I can provide u.......
|
|
|
|
|
I have already found a BasicDatePicker Control,which has a .js file.
Its working fine on my local PC.But cannot find that .js file on the server and giving error.
I have given that .js file.still same error.
also tell me whether bin folder is the root folder for any web application or not.
Ajay
|
|
|
|
|
Use this js file.Copy this code in Calender.js file and make a js folder on root and save this js file there.Then u need to add the js file link syntax I have given below.Finally u have to add the selected date in the textbox this also I have given.
1:Save as Calender.js
var ele;
var selDay, selMonth ,selYear;
var parentWin;
var iYear;
var incyear ;
var newWin;
function funcClose(strDate)
{
var arr_date = strDate.split('/');
if (arr_date.length != 3)
{
}
else
{
if(arr_date[0]>=1 && arr_date[0]<=9)
arr_date[0] = 0 + arr_date[0];
if(arr_date[1]>=1 && arr_date[1]<=9)
arr_date[1] = 0 + arr_date[1];
}
strDate = arr_date[0]+'/'+arr_date[1]+'/'+arr_date[2];
ele.value = strDate
newWin.close()
}
function GetNoOfDaysInAMonth(iMonth ,iYear)
{
var intDays
switch (iMonth)
{
case "1":
intDays= 31
break;
case "2" :
if (((iYear % 4 == 0) && (iYear % 100 != 0)) || (iYear % 400 == 0))
intDays = 29
else
intDays = 28
break;
case "3":
intDays = 31
break;
case "4":
intDays = 30
break;
case "5":
intDays = 31
break;
case "6" :
intDays = 30
break;
case "7" :
intDays = 31
break;
case "8":
intDays = 31
break;
case "9":
intDays = 30
break;
case "10":
intDays = 31
break;
case "11":
intDays = 30
break;
case "12":
intDays = 31
break;
}
return (intDays)
}
function FillMonthCombo()
{
//document.frm.cboMonth.appendChild.nodeValue ="<option>Jan</option>"
}
function incYear()
{
//incyear = parseInt(incyear) + 1
//Build_calendar()
}
function decYear()
{
//incyear = parseInt(incyear) - 1
//Build_calendar()
}
function Calendar()
{
var TotalDays;
var strCalendar;
var strStartDay;
var intCnt;
var intDays;
var vsCnt;
var i;
ele = arguments[0]
if (ele.value !="")
var currentDate = new Date(ele.value);
else
var currentDate = new Date();
selDay = currentDate.getDate()
selMonth = currentDate.getMonth()
selYear = currentDate.getFullYear()
if(newWin!=null)
newWin.close();
newWin = window.open("","Calendar","height=250,width=300,left=200,top=200");
parentWin = window.opener
newWin.document.write ('<html><title>Select Date</title><head><link href="../css/G_CSS1024.css" rel="stylesheet" type="text/css"></head>')
newWin.document.write ('<body><table align=center valign=top border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img src=../images/gr_head.gif width=100% height=26></td></tr><tr><td align=center class=frmTxt><form name="frm">')
newWin.document.write ('<font class=bold>Month :</font><select Class="inputtxt" name=cboMonth onchange="window.opener.Build_calendar()">')
vsSel =""
if (parseInt(selMonth) == 0)
vsSel = " selected"
newWin.document.write ('<option value="1" ' + vsSel + ' >Jan</option>')
vsSel =""
if (parseInt(selMonth) == 1)
vsSel = " selected"
newWin.document.write ('<option value="2" ' + vsSel + '>Feb</option> ')
vsSel =""
if (parseInt(selMonth) == 2)
vsSel = " selected"
newWin.document.write ('<option value="3" ' + vsSel + '>Mar</option> ')
vsSel =""
if (parseInt(selMonth) == 3)
vsSel = " selected"
newWin.document.write ('<option value="4" ' + vsSel + '>Apr</option> ')
vsSel =""
if (parseInt(selMonth) == 4)
vsSel = " selected"
newWin.document.write ('<option value="5" ' + vsSel + '>May</option> ')
vsSel =""
if (parseInt(selMonth) == 5)
vsSel = " selected"
newWin.document.write ('<option value="6" ' + vsSel + '>Jun</option> ')
vsSel =""
if (parseInt(selMonth) == 6)
vsSel = " selected"
newWin.document.write ('<option value="7" ' + vsSel + '>Jul</option> ')
vsSel =""
if (parseInt(selMonth) == 7)
vsSel = " selected"
newWin.document.write ('<option value="8" ' + vsSel + '>Aug</option> ')
vsSel =""
if (parseInt(selMonth) == 8)
vsSel = " selected"
newWin.document.write ('<option value="9" ' + vsSel + '>Sep</option> ')
vsSel =""
if (parseInt(selMonth) == 9)
vsSel = " selected"
newWin.document.write ('<option value="10" ' + vsSel + '>Oct</option>')
vsSel =""
if (parseInt(selMonth) == 10)
vsSel = " selected"
newWin.document.write ('<option value="11" ' + vsSel + '>Nov</option>')
vsSel =""
if (parseInt(selMonth) == 11)
vsSel = " selected"
newWin.document.write ('<option value="12" ' + vsSel + '>Dec</option>')
newWin.document.write ('</select> ')
newWin.document.write ('<font class=bold>Year :</font><select Class="inputtxt" name=cboYear onchange="window.opener.Build_calendar()"> ')
for (intCnt = 1900 ; intCnt < 2050 ;intCnt ++)
{
if(parseInt(selYear) == parseInt(intCnt))
newWin.document.write ('<option value= ' + intCnt + ' selected >' + intCnt +' </option>')
else
newWin.document.write ('<option value= ' + intCnt + '>' + intCnt +' </option>')
}
//document.write ('<option value=2001>2001</option>')
//document.write ('<option value=2002>2002</option>')
//document.write ('<option value=2003>2003</option>')
newWin.document.write ('</select><br><img src=../images/blank.gif height=4>')
newWin.document.write ('<div id="CalID"></div><br><div id=curDate style="background-image:url(../images/gr_head.gif);"></div>')
newWin.document.write ('</form></td></tr></table></body></html>')
iYear = newWin.document.frm.cboYear.value
incyear =iYear
var dtm = new Date();
newWin.curDate.innerHTML ="Today's Date is "+ dtm.toDateString() ;
Build_calendar ()
}
function Build_calendar ()
{
iMonth = newWin.document.frm.cboMonth.value
iYear = newWin.document.frm.cboYear.value
//iYear = incyear
var strDate = new Date(iMonth + "/1/" + iYear )
strStartDay = strDate.getDay ()
TotalDays = GetNoOfDaysInAMonth (iMonth,iYear)
strCalendar = "<table width=100% cellpadding=1 cellspacing=1 border=0 ><tr><td colspan=7 class='Data_hd' width='100%'>" + newWin.document.frm.cboMonth[newWin.document.frm.cboMonth.value-1].innerText + " " + iYear + "</td></tr>"
strCalendar = strCalendar + "<tr align=center><td class='bold'>Sun</td><td class='bold'>Mon</td><td class='bold'> Tue</td><td class='bold'>Wed</td><td class='bold'>Thu</td><td class='bold'>Fri</td><td class='bold'>Sat</td></tr>"
strCalendar = strCalendar + "<tr align=center>"
for (intCnt = 1 ;intCnt <= strStartDay;intCnt++)
{
strCalendar = strCalendar + "<td class=frmTxt> </td>"
}
intDays = 1
for (intCnt = strStartDay; intCnt < 7 ;intCnt++)
{
strDateVal = iMonth + "/" + intDays + "/" + iYear
if (parseInt(selDay) == parseInt(intDays))
strCalendar = strCalendar + "<td class=Today><a href=# onclick=window.opener.funcClose('"+ strDateVal + "')>" + intDays + "</a></td>"
else
strCalendar = strCalendar + "<td class=frmTxt><a href=# onclick=window.opener.funcClose('"+ strDateVal + "')>" + intDays + "</a></td>"
intDays = intDays + 1
}
strCalendar = strCalendar + "</tr><tr align=center>"
vsCnt=0
for (i=intDays ; i<= TotalDays ; i++)
{
strDateVal = iMonth + "/" + i + "/" + iYear
if (vsCnt == 7)
{
vsCnt =0
strCalendar = strCalendar + "<tr align=center>"
}
if (parseInt(selDay) == parseInt(i))
strCalendar = strCalendar + ("<td class=Bold><a href=# onclick= window.opener.funcClose('"+ strDateVal +"')>" + i + "</a></td>")
else
strCalendar = strCalendar + ("<td class=frmTxt><a href=# onclick= window.opener.funcClose('"+ strDateVal +"')>" + i + "</a></td>")
vsCnt = vsCnt + 1
}
strCalendar = strCalendar + "</table>"
newWin.CalID.innerHTML = strCalendar
}
2:Put this in Head tag
<script language="javascript" type="text/javascript" src="../js/Calender.js"></script>
3:this is the textbox where u want the selected date.
<A onclick="javascript:Calendar(frmBillingTabDetails.GI_txtReceivedDate)" href="#">
<input name="GI_txtReceivedDate" type="text" class="text" id="GI_txtReceivedDate" style="width: 120px" maxlength=8 readOnly Runat="server">
<IMG height="22" src="../images/show-calendar.gif" width="22" align="absMiddle" border="0" alt="Pick Received Date"></A>
Hope this will help u.Please let me know if u have any problem...
|
|
|
|
|
thanks for the code
i follow your instructions.
Problems are--
1.cannot see any image(i think u have not given the image thats why?)
2.when i m going to click on the image it shows the error
'frmBillingtabDetails' is undefined.
|
|
|
|
|
was just think that I forgot to tell u about the frmBillingtabDetails, it is nothing but the form name which there at
<form id="frmBillingTabDetails" runat="server">
and regarding Image u cal take any calender imageand replace the link of src in img tag
<IMG height="22" src="UR IMAGE LINK" width="22" align="absMiddle" border="0" alt="Pick Received Date">
Hope now it works........
|
|
|
|
|
I have already replaced the frmBillingTabDetails with my form's Id.
Now the error comes when i click on the Link.
"Object Expected."
|
|
|
|
|
Please post the code......
|
|
|
|
|
Hi,
I have gone through this code snippet and tried to implement in one sample appln. i am using asp.net 2.0.
I got an error like this "frmBillingTabDetails is undefined". Then i replaced frmBillingTabDetails with Default(thats the name of page<default.aspx>). Again it showed the same error.
will you help me!
Sebastian
|
|
|
|
|
U can read my reply......
|
|
|
|