|
Hi Murali,
i hv tried using EditItemTemplate as u said... but itisn't showing any textboxes there...
fyi, i'm a girl..
Thanks,
Durga.
|
|
|
|
|
hello durga,
in the edit item template u need to declare the asp:textbox it will not come automatically.try u will get...
ok byeee
Murali
|
|
|
|
|
I have tried it already, but it doesn't show up anything.....
|
|
|
|
|
hi durga,
put
OleDbCommand cmd = new OleDbCommand(strQuery, myConnection);
cmd.ExecuteNonQuery();
code in foreach loop .. now u will get what u want and put where cluase in your query
pallavi
|
|
|
|
|
Thanks for the kind help Pallavi.. My problem solved now..
|
|
|
|
|
Hi
in your code errore is in the this line "strQuery = "UPDATE [RfqInfo] SET [Partno]= '" + str + "', [mfg] = '" + str1 + "', [qty] = '" + str2 + "'";
"
you have not mantioned any whare condition for updating particuler row thats why when last time ur query get executed it update all rows by last row in ur gridview .
Hirdesh
|
|
|
|
|
Hi Hirdesh,
thanks for replying...
I have included the where condition but its showing.. "Syntax error (missing operator) in query expression '[Sno] = Sno[1]'."
here is code snippet:
int i = dgRow.RowIndex + 1;
str = ((TextBox)myGridView1.Rows[dgRow.RowIndex].FindControl("txtPartNo")).Text.ToString();
strQuery = "UPDATE [RfqInfo] SET [Partno]= '" + str + "', [mfg] = '" + str1 + "', [qty] = '" + str2 + "' WHERE [Sno] = Sno[" + i + "]";
plz help me...
|
|
|
|
|
replace your query string by
strQuery = "UPDATE [RfqInfo] SET [Partno]= '" + str + "', [mfg] = '" + str1 + "', [qty] = '" + str2 + "' WHERE [Sno] = " + i;
i'm sure ur code will run fine.
Hirdesh
|
|
|
|
|
Hi, yup.. it worked very well now...Thank youveryyy much, once again thanks a lot..
|
|
|
|
|
what is App.ico in .net? Can anybody explain me about it. i can't get a clear idea about it.
|
|
|
|
|
.ico is an extention for icon for starters.
Therefore App.ico = Application Icon.
|
|
|
|
|
This is default icon for your application.
God Bless you.
Always do good to others
|
|
|
|
|
Hi,
can anyone say what is the error in the following code. the value present in the datagrid is not getting stored in the variable "assetcode".
Protected Sub dgresult_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgresult.SelectedIndexChanged
Dim assetcode As String
assetcode = dgresult.SelectedItem.Cells(1).Text
Response.Redirect("Edit_UPS.aspx?assetcode=" + assetcode + " ")
End Sub
|
|
|
|
|
What is the error message you are getting??
There is no property of DataGrid called SelectedItem by the way !!
|
|
|
|
|
It is not giving any error. But just not working. As I know this property is used to select the value in a particular column and in fact it is working for me in other pages. But I could not figure it out why it is not working here. Here is the complete code.
Imports System.Web.Security
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Configuration
Imports System.Collections
Imports System.Data.SqlClient.SqlConnection
Partial Class Searchups
Inherits System.Web.UI.Page
Dim sqlstr As String
Dim vstr As String
Dim flag As Boolean
Dim constr As String = ConfigurationSettings.AppSettings("conn")
Dim dbconn As New SqlConnection(constr)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Txtasscd.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + Btnsearch.UniqueID + "').click();return false;}} else {return true}; ")
Ddl.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + Btnsearch.UniqueID + "').click();return false;}} else {return true}; ")
Ddmdl.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + Btnsearch.UniqueID + "').click();return false;}} else {return true}; ")
tbreg.Visible = False
tabdg.Visible = False
Calendar1.Visible = False
Calendar2.Visible = False
If Page.IsPostBack = False Then
bindmodel()
bindlocation()
bindoff()
increment()
bindmdl()
vstr = ViewState("vstr")
End If
End Sub
Sub bindmodel()
Dim sqlstr As String
sqlstr = "select model from a_upsmodel order by model"
Dim comm As New SqlCommand(sqlstr, dbconn)
Dim dr As SqlDataReader
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
dr = comm.ExecuteReader
While dr.Read
Ddmdl.Items.Add(dr.Item(0).ToString)
End While
dr.Close()
End Sub
Sub bindresult(ByVal sqlstr As String)
Dim ds As New DataSet()
Dim comm As New SqlDataAdapter(sqlstr, dbconn)
dgresult.DataSource = ds
comm.Fill(ds)
dgresult.DataBind()
'navi.Visible = True
'lblnopg.Text = dgresult.PageCount
End Sub
Sub bindlocation()
Dim sqlstr As String
sqlstr = "select location from a_location order by location"
Dim comm As New SqlCommand(sqlstr, dbconn)
Dim dr As SqlDataReader
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
dr = comm.ExecuteReader
While dr.Read
Ddl.Items.Add(dr.Item(0).ToString)
End While
dr.Close()
End Sub
Sub bindoff()
Dim sqlstr As String
sqlstr = "select location from a_location order by location"
Dim comm As New SqlCommand(sqlstr, dbconn)
Dim dr As SqlDataReader
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
dr = comm.ExecuteReader
While dr.Read
Ddoff.Items.Add(dr.Item(0).ToString)
End While
dr.Close()
End Sub
Sub bindmdl()
Dim sqlstr As String
sqlstr = "select model from a_upsmodel order by model"
Dim comm As New SqlCommand(sqlstr, dbconn)
Dim dr As SqlDataReader
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
dr = comm.ExecuteReader
While dr.Read
DDmodel.Items.Add(dr.Item(0).ToString)
End While
dr.Close()
End Sub
Sub increment()
Dim sqlstr4 As String
Dim dr4 As SqlClient.SqlDataReader
Dim comm As New SqlCommand()
sqlstr4 = "select uno from a_mstr_uno where regno=(select max(regno)from a_mstr_uno)"
Dim sqlcomm4 As New SqlClient.SqlCommand(sqlstr4, dbconn)
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
dr4 = sqlcomm4.ExecuteReader()
Dim vcd As String
While dr4.Read
vcd = dr4.Item("uno")
End While
dbconn.Close()
dr4.Close()
vcd = vcd
vcd = vcd.Substring(1)
vcd = CInt(vcd)
If (vcd >= 1 And vcd <= 9) Then
vcd = vcd + 1
Txtascd.Text = "U0" & vcd.ToString()
ElseIf (vcd >= 10 And vcd <= 99) Then
vcd = vcd + 1
Txtascd.Text = "U" & vcd.ToString()
End If
End Sub
Protected Sub Btnsearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Btnsearch.Click
tabdg.Visible = True
If Txtasscd.Text.Trim = "'" Then
Txtasscd.Text = ""
Exit Sub
End If
dgresult.CurrentPageIndex = 0
ViewState.Remove("vstr")
If Txtasscd.Text.Trim <> "" Then
vstr = " and Assetcode like '" & Txtasscd.Text.Trim & "%'"
ViewState("vstr") = vstr
End If
If Ddmdl.SelectedIndex <> 0 Then
vstr = " and model='" & Ddmdl.SelectedItem.ToString() & "'"
ViewState("vstr") += vstr
End If
If Ddl.SelectedIndex <> 0 Then
vstr = " and location='" & Ddl.SelectedItem.ToString() & "'"
ViewState("vstr") += vstr
End If
vstr = ViewState("vstr")
sqlstr = "select a.AssetCode,a.SerialNumber,a.Model,'NoOfSystemsConnected'=a.NoOfSystems,a.Capacity,a.Location,a.Sub_Location,a.Status,a.Vendor,'Amc Date'=a.amc,'Wty Date'=Wty,a.Remarks from A_ups a,a_mstr_uno u where a.assetcode=u.uno" + vstr + " order by u.regno asc"
ViewState("sqlstr") = sqlstr
' bindresult(sqlstr)
If dgresult.AllowPaging = True Then
sqlstr = ViewState("sqlstr")
dgresult.AllowPaging = False
bindresult(sqlstr)
tabdg.Visible = True
Else
sqlstr = ViewState("sqlstr")
dgresult.AllowPaging = True
bindresult(sqlstr)
tabdg.Visible = True
End If
End Sub
Sub clear()
Ddoff.SelectedIndex = 0
Ddmdl.SelectedIndex = 0
Txtvendor.Text = ""
Txtnsys.Text = ""
Txtamc.Text = Now.Date
Txtwty.Text = Now.Date
Txtremark.Text = "Nil"
Txtcapacity.Text = ""
Txtlocation.Text = ""
txtslno.Text = ""
increment()
End Sub
Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
tbreg.Visible = True
If Ddoff.SelectedIndex = 0 Then
lblmsg.Text = "Select the Location !"
lblmsg.ForeColor = Drawing.Color.Red
lblmsg.Visible = True
Exit Sub
End If
If (txtslno.Text = "") Then
lblmsg.Visible = True
lblmsg.ForeColor = Drawing.Color.Red
lblmsg.Text = "Enter Serial Number"
Exit Sub
End If
If DDmodel.SelectedIndex = 0 Then
lblmsg.Text = "Select the model !"
lblmsg.ForeColor = Drawing.Color.Red
lblmsg.Visible = True
Exit Sub
End If
Dim orderid As Integer
Dim sqlstr As String
Dim sqlstr1 As String
Dim dr As SqlDataReader
flag = False
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
sqlstr = "select regno from a_mstr_uno order by regno"
Dim comm2 As New SqlCommand(sqlstr, dbconn)
dr = comm2.ExecuteReader
While dr.Read
orderid = dr.Item(0)
End While
dr.Close()
dbconn.Close()
orderid = orderid + 1
sqlstr = "insert into a_ups (assetcode,Location,Sub_Location,serialnumber,vendor, model,amc,wty,capacity,Noofsystems,status,REMARKS) values ('" & Txtascd.Text.ToUpper() & "','" & Ddoff.SelectedItem.ToString() & "','" & Txtlocation.Text & "','" & txtslno.Text & "','" & Txtvendor.Text & "','" & Ddmdl.SelectedItem.ToString() & "','" & Txtamc.Text.Trim & "','" & Txtwty.Text.Trim & "','" & Txtcapacity.Text & "','" & Txtnsys.Text & "','" & DDstatus.SelectedItem.ToString() & "','" & Txtremark.Text & "')"
sqlstr1 = "insert into a_mstr_uno(Uno,regno,serialno)values('" & Txtascd.Text.Trim & "', '" & orderid & "','" & txtslno.Text.Trim & "')"
Dim comm As New SqlCommand(sqlstr, dbconn)
Dim comm1 As New SqlCommand(sqlstr1, dbconn)
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
Try
comm.ExecuteNonQuery()
comm1.ExecuteNonQuery()
lblmsg.Text = "Registered successfully !"
lblmsg.ForeColor = Drawing.Color.Green
lblmsg.Visible = True
clear()
Catch ex As Exception
lblmsg.Text = ex.ToString
' lblmsg.Text = "Could not save"
lblmsg.ForeColor = Drawing.Color.Red
lblmsg.Visible = True
End Try
End Sub
Protected Sub ImageButton2_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton2.Click
tbreg.Visible = True
Calendar1.Visible = True
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Txtamc.Text = Calendar1.SelectedDate
Calendar1.Visible = False
tbreg.Visible = True
End Sub
Protected Sub ImageButton4_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton4.Click
Calendar2.Visible = True
tbreg.Visible = True
End Sub
Protected Sub Calendar2_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar2.SelectionChanged
Txtwty.Text = Calendar2.SelectedDate
Calendar2.Visible = False
tbreg.Visible = True
End Sub
Protected Sub btncreate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btncreate.Click
tbreg.Visible = True
End Sub
Protected Sub dgresult_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgresult.SelectedIndexChanged
Dim assetcode As String
assetcode = dgresult.SelectedItem.Cells(1).Text
Response.Redirect("Edit_UPS.aspx?assetcode=" + assetcode + " ")
End Sub
End Class
|
|
|
|
|
Sorry, my bad, I was thinking of Windows form, Whats the error Message by the way!!
|
|
|
|
|
In the network .i have a webservice in a webserver and i want to call that webservice from a client machine to get data using javascript .
url="http://localhost/Chat/MsgBoxService.asmx/Get?" + str + "&type=agent&sMsg=";
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange();
req.open('GET', url, true);
req.send();
// branch for IE/Windows ActiveX version
}
else if (window.ActiveXObject)
{
isIE = true;
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
alert(url);
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.send();
}
|
|
|
|
|
i was doing deployment project .But at the client machine the code behind files with there as well.
any idea to sort out this problem ?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
when you add files in setup and deployment, just remove the source files, then you wont get code files in your client machine
Regards,
Sylvester G
If we don't succeed, we run the risk of failure
|
|
|
|
|
i am currently adding the project output.
project output is adding both the code behind file as well as the aspx pages.
so during deployment project , i am not being able to eliminate the code behind file.
so after deploymnet , i need to manually delete the code behind file ?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
While adding project output , dont select the source files.
Select only Primary output and content files.
Regards,
Sylvester G
If we don't succeed, we run the risk of failure
|
|
|
|
|
Sonia Gupta wrote: i was doing deployment project
You can use PublishWebsite option before adding files to Setup and Deployment wizard.
|
|
|
|
|
Hi,
I trying to create image gallery by simply drag and drop the images from external folder.
This I have to do in asp.net or javascript. Is any control or software available.
If possible can any one send me sample code?
can any one help me ?
Thanks in advance.
|
|
|
|
|
Hi, I'm getting the exception "Value of type Byte cannot be converted to 1-dimensional array of Byte", when running my code. The following is my code snippet. Please help determine what the cause of the exception is, thank you in advance for your help.
<br />
Private Sub CreateImage(ByVal id As String)<br />
' Connectoin string is taken from web.config file.<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 />
<br />
' This is optional<br />
Response.ContentType = "image/gif"<br />
<br />
'stream it back in the HTTP response<br />
<br />
<br />
Response.BinaryWrite(_buf)<br />
Catch<br />
Finally<br />
<br />
_con.Close()<br />
End Try<br />
End Sub<br />
|
|
|
|
|
ASPnoob wrote: Dim _buf As Byte() = CByte(_cmd.ExecuteScalar())
Dim _buf() As Byte=CByte.Parse(_cmd.ExecuteScalar())
try like this.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|