SEARCH YOUR SOLUTION HERE  

This Update will not work!!

"INPUT STRING NOT CORRECT"

PO_Number being my Key Field...would this cause a problem

Dim strSQL As String = _
"UPDATE [Table] SET [Freight] = @Freight," & _
"[Total] = @Total WHERE PO_Number = '" & lblPO.Text & "'"

Dim cn As SqlConnection = New SqlConnection()

Dim cmdExp As SqlCommand

cn.Open()

cmdExp = New SqlCommand(strSQL, cn)

Dim FreightParam As New SqlParameter("@Freight", SqlDbType.Money)
Dim TotalParam As New SqlParameter("@Total", SqlDbType.Money)

FreightParam.Value = txtFreight.Text
TotalParam.Value = lblPOTotal.Text

cmdExp.Parameters.Add(FreightParam)
cmdExp.Parameters.Add(TotalParam)

cmdExp.ExecuteNonQuery()

Posted On: Tuesday 1st of January 2013 09:53:48 PM Total Views:  178
View Complete with Replies




Related Messages:

OnMouseOver Backround Image   (226 Views)
I've setup an ASP Table and add addtributes to change the background image of the cell to change onmouseover. The problem is, that if I set the background of the cell as well, then my onmouseover command doesn't do anything. My Code is below.
SQL stored procedure declaration aspx.vb {resolved}   (366 Views)
I'm trying to do some sql statements in my asp. I have a my sql statement all created. I'm kind of lost on how to integrate my sql statement into my aspx.vb Need help in declaration.Here is my code:Code: create procedure ChartNumIncr as Set Identity_Insert chartassignment on insert into chartassignment(med_chart#) select Max(med_chart#)+1 from chartassignment set Identity_Insert chartassignment offI get blue squiglies under the words I have in red bold.
asp.net tools   (140 Views)
What do you use for asp.net development outside of visual studio. Drydo said he used Macromedia at work for asp etc. What about asp.net I know it will do that also, but seems rather complicated for asp.net development. I couldn't even figure out how to add a reference or a code behind page.Is there anything better than vs.net
Session_End() and the Cache   (187 Views)
[VB.NET]When a user's Session expires, I'd like to remove certain things from the Cache. For instance, some data items I've stored using the user's SessionID, so using that, I could remove some of these things from the Cache......if I could get to it.I know how to iterate the Cache, but the Context object is Nothing when the Session_End() event fires! Take a look at my code: '------------------------------------------------------------------------- ' Session_End() '------------------------------------------------------------------------- Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) Try Dim oIEnumerator As IDictionaryEnumerator Dim oDictionaryEntry As System.Collections.DictionaryEntry Dim sKey As String Dim sKeyPrefix As String = Me.Session.SessionID & "." 'Dim sPrefixes() As String = {Me.Session.SessionID & ".Query.", Me.Session.SessionID & ".QueryPreview"} 'Dim sSuffixes() As String = {".DataSet", ".DataView"} '// EXCEPTION: Object reference not set to an object '// This occurs because Me.Context is Nothing! '// How do I get to the Cache from here oIEnumerator = Me.Context.Cache.GetEnumerator While (oIEnumerator.MoveNext) oDictionaryEntry = CType(oIEnumerator.Current, System.Collections.DictionaryEntry) sKey = oDictionaryEntry.Key.ToString() If (sKey.StartsWith(sKeyPrefix)) Then Call Context.Cache.Remove(sKey) End If End While Catch oException As System.Exception '** Do nothing Stop End Try End SubHow can I get to the Cache from the Session_End() event and remove those things I need to remov
printing a listbox   (256 Views)
i ahve a list box with informnation in and want to print the information when a command button is pressed. my pages are aspx pages in visual studio. my project is a website and so i cannot find a way of adding a print dialog which is possible whwne using a project. can anyone sugest any code to print the list boxes please
write in the web.config   (180 Views)
Hi! I have an ASP.NET application (vb) where I have to save three important string in the web.config, becouse later I have to acces for other application and obtain the Strings. My duve is how Can I write the web.config adding vlues with keys. I know that I have to use "appsetings" but I don't Know how to do it, I am very beginner with this kind of things. If somebody can help me would be great! Thank you! Pablo
ASP Shopping cart help   (243 Views)
I have a shopping cart that was done by someone else a while ago and it has suddenly stopped working. It is in ASP not ASP.net Three different pages have the same type of code line in each. Here are the lines of code: Page one: Page two: Page three: These are the only pages within the shopping cart code that do not work. I can add things to the cart without any problems. Each page shows the same error. "Object expected" from a line on the page that does not exist. Any suggestions
Help with regular expressions.   (148 Views)
I've a BoundColumn in a datagrid, mapping a "money" column in a SQLIt shows like this: 12600.0000I just want to show the int part (ie: 12600).I've tried giving a Data Formatting Expresion in the datagrid (with the DataFormatString= property)I've tried with DataFormatString="/d" DataFormatString="/d{*,0}" but it gives me an errorDo someone know how can I format a regularexpression that shows me just the integer part of the decimal numbe
Asp.net paging and find function not working properly.   (188 Views)
I have a listview with a search function and a pager. The search function allows me to search for an item and then fills the listview. Everything work fine until I click the "Next" pager button. When I do a search after click this "Next" button, I get an empty listview the first time. If I click "Find" again I get the correct results but then my "Edit" breaks. Please help. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; using System.Drawing; using System.Data.SqlClient; using System.Configuration; using System.Data; public partial class Controls_ManageFundsControl : System.Web.UI.UserControl { private void BindFundNoTable() { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; //ManageFundNoListView.DataSourceID = null; SqlConnection HighlanderVMconn = new SqlConnection(ConfigurationManager.ConnectionStrings["HighlanderVMconn"].ConnectionString); HighlanderVMconn.Open(); SqlCommand cmdExecFindALLFundNoSP = new SqlCommand("DisplayALLFundsSP", HighlanderVMconn); cmdExecFindALLFundNoSP.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmdExecFindALLFundNoSP); DataSet ds = new DataSet(); da.Fill(ds, "DisplayALLFundNotable"); ManageFundNoListView.DataSource = ds.Tables["DisplayALLFundNotable"]; ManageFundNoListView.DataBind(); HighlanderVMconn.Close(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindFundNoTable(); } } protected void FindFundNoButton_onclick(object sender, EventArgs e) { if (!Page.IsValid) { return; } ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; if (FindFundNoTextBox != null && ManageFundNoListView != null) { //Makes SQl connection SqlConnection HighlanderVMconn = new SqlConnection(ConfigurationManager.ConnectionStrings["HighlanderVMconn"].ConnectionString); HighlanderVMconn.Open(); SqlCommand cmdExecFindFundNoSP = new SqlCommand("FindFundsSP", HighlanderVMconn); cmdExecFindFundNoSP.CommandType = CommandType.StoredProcedure; cmdExecFindFundNoSP.Parameters.AddWithValue("@FundNo", FindFundNoTextBox.Text); SqlDataAdapter da = new SqlDataAdapter(cmdExecFindFundNoSP); DataSet ds = new DataSet(); da.Fill(ds, "FindFundNotable"); ManageFundNoListView.DataSource = ds.Tables["FindFundNotable"]; ManageFundNoListView.DataBind(); HighlanderVMconn.Close(); } } protected void ListViewItemEditing(object sender, ListViewEditEventArgs e) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; ManageFundNoListView.EditIndex = e.NewEditIndex; BindFundNoTable(); } protected void ListViewItemUpdating(object sender, ListViewUpdateEventArgs e) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; ListViewItem item = ManageFundNoListView.Items[e.ItemIndex]; TextBox DistIDTextBox = (TextBox)item.FindControl("DistIDTextBox"); // ManageFundNoListView.DataSourceID = null; string FundNo = ManageFundNoListView.DataKeys[e.ItemIndex].Value.ToString(); SqlConnection HighlanderVMconn = new SqlConnection(ConfigurationManager.ConnectionStrings["HighlanderVMconn"].ConnectionString); HighlanderVMconn.Open(); SqlCommand cmdExecUpdateFundNoSP = new SqlCommand("UpdateFundsSP", HighlanderVMconn); cmdExecUpdateFundNoSP.CommandType = CommandType.StoredProcedure; cmdExecUpdateFundNoSP.Parameters.AddWithValue("@FundNo", FundNo); cmdExecUpdateFundNoSP.Parameters.AddWithValue("@DistId", DistIDTextBox.Text); cmdExecUpdateFundNoSP.ExecuteNonQuery(); ManageFundNoListView.EditIndex = -1; BindFundNoTable(); } protected void ListViewItemCanceling(object sender, ListViewCancelEventArgs e) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; ManageFundNoListView.EditIndex = -1; BindFundNoTable(); } protected void InsertListViewItem(object sender, ListViewInsertEventArgs e) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; // ManageFundNoListView.DataSourceID = null; ListViewItem item = e.Item; TextBox FundNoTextBox = (TextBox)item.FindControl("FundNoTextBox"); TextBox DistIDTextBox = (TextBox)item.FindControl("DistIDTextBox"); SqlConnection HighlanderVMconn = new SqlConnection(ConfigurationManager.ConnectionStrings["HighlanderVMconn"].ConnectionString); HighlanderVMconn.Open(); SqlCommand cmdExecInsertFundNoSP = new SqlCommand("InsertFundsSP", HighlanderVMconn); cmdExecInsertFundNoSP.CommandType = CommandType.StoredProcedure; cmdExecInsertFundNoSP.Parameters.AddWithValue("@FundNo", FundNoTextBox.Text); cmdExecInsertFundNoSP.Parameters.AddWithValue("@DistId", DistIDTextBox.Text); cmdExecInsertFundNoSP.ExecuteNonQuery(); BindFundNoTable(); } protected void ListViewDeleteItem(object sender, ListViewDeleteEventArgs e) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; ListViewItem item = ManageFundNoListView.Items[e.ItemIndex]; // ManageFundNoListView.DataSourceID = null; string FundNo = ManageFundNoListView.DataKeys[e.ItemIndex].Value.ToString(); SqlConnection HighlanderVMconn = new SqlConnection(ConfigurationManager.ConnectionStrings["HighlanderVMconn"].ConnectionString); HighlanderVMconn.Open(); SqlCommand cmdExecDeleteFundsSP = new SqlCommand("DeleteFundsSP", HighlanderVMconn); cmdExecDeleteFundsSP.CommandType = CommandType.StoredProcedure; cmdExecDeleteFundsSP.Parameters.AddWithValue("@FundNo", FundNo); cmdExecDeleteFundsSP.ExecuteNonQuery(); HighlanderVMconn.Close(); //ManageFundNoListView.DataSourceID = "ManageFundsSqlDataSource"; FindFundNoTextBox.Text = "Search FundNo."; BindFundNoTable(); } protected void PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; DataPager pager = (DataPager)((ListView)sender).FindControl("DataPager1"); pager.SetPageProperties(e.StartRowIndex, e.MaximumRows, false); BindFundNoTable(); } //*****************************************Custom Validators************************************************* protected void FindFundNoMessageCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FindFundNoTextBox = ManageFundNoListView.FindControl("FindFundNoTextBox") as TextBox; ManageFundNoListView.EditIndex = -1; //Makes SQl connection SqlConnection HighlanderVMconn = new SqlConnection(ConfigurationManager.ConnectionStrings["HighlanderVMconn"].ConnectionString); HighlanderVMconn.Open(); SqlCommand cmdExecCheckFundsExistsSP = new SqlCommand("CheckFundsExistsSP", HighlanderVMconn); cmdExecCheckFundsExistsSP.CommandType = CommandType.StoredProcedure; cmdExecCheckFundsExistsSP.Parameters.AddWithValue("@FundNo", FindFundNoTextBox.Text); cmdExecCheckFundsExistsSP.CommandType = CommandType.StoredProcedure; int ResultsCount = Convert.ToInt32(cmdExecCheckFundsExistsSP.ExecuteScalar().ToString()); if (ResultsCount == 0) { args.IsValid = false; } HighlanderVMconn.Close(); } protected void FindFundNoDupMessageCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) { ListView ManageFundNoListView = this.FindControl("ManageFundsListView") as ListView; TextBox FundNoTextBox = ManageFundNoListView.InsertItem.FindControl("FundNoTextBox") as TextBox; ManageFundNoListView.EditIndex = -1; //Makes SQl connection SqlConnection HighlanderVMconn = new SqlConnection(ConfigurationManager.ConnectionStrings["HighlanderVMconn"].ConnectionString); HighlanderVMconn.Open(); SqlCommand cmdExecCheckFundsExistsSP = new SqlCommand("CheckFundsExistsSP", HighlanderVMconn); cmdExecCheckFundsExistsSP.CommandType = CommandType.StoredProcedure; cmdExecCheckFundsExistsSP.Parameters.AddWithValue("@FundNo", FundNoTextBox.Text); cmdExecCheckFundsExistsSP.CommandType = CommandType.StoredProcedure; int ResultsCount = Convert.ToInt32(cmdExecCheckFundsExistsSP.ExecuteScalar().ToString()); if (ResultsCount != 0) { args.IsValid = false; } HighlanderVMconn.Close(); } } //*****************************************Custom Validators End*************************************************
html page calls default.aspx.vb and gets Ispostback false   (351 Views)
I have an asp html page that allows the user to input data into a web page. When they click the submit button it calls a default.aspx.vb. The ISPostback is always false so it skips my sql add parameters. Here is the code: GDR Request Form jQuery(document).ready(function ($) { $("#txtCommercial").mask("(999) 999-9999"); }); Commercial: DSN: **************************************************** Default.aspx.vb **************************************************** Imports System.Data.SqlClient Imports System.Data Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Me.Load txtRequester_Date.Text = Date.Today txtRequestDate.Text = Date.Today If (IsPostBack) Then ' this creates the connection. Dim sqlConn As New SqlConnection("Data Source=JITC-PC\GEOINT; Initial catalog=DEV_GEOINT; Integrated Security=SSPI;") ' create the command object Dim sqlCmd As New SqlCommand("sp_InsertRequest", sqlConn) ' define the connection for the command object sqlCmd.Connection = sqlConn sqlCmd.CommandType = CommandType.StoredProcedure ' define the SQL parameter sqlCmd.Parameters.AddWithValue("@Org", txtOrganization.Text) sqlCmd.Parameters.AddWithValue("@REQ_Date", txtRequester_Date.Text) ' open the connection sqlConn.Open() ' execute the data insertion sqlCmd.ExecuteNonQuery() ' close SQL connection sqlConn.Close() ' dispose of the connection object (mostly optional but good practice) sqlConn.Dispose() ' Notify the submission was accepted Response.Write("Thank-you for your Request!") End If End Sub Private Function isempty(ByVal p1 As Object) As String Throw New NotImplementedException End Function End Class This post has been edited by Dormilich: 21 October 2012 - 01:18 AM Reason for edit:: fixed code tags
Error when checking .IsCrossPagePostBack   (185 Views)
Hi all, I am trying to use the PreviousPage and IsCrossPagePostBack properties, but I keep getting errors. I am using this block of code from msdn: If PreviousPage IsNot Nothing Then If PreviousPage.IsCrossPagePostBack = True Then 'do something End If Else 'do something End If However, I keep getting the error "Null reference Exception", "Object reference is not set to an instance of an object" on the line: If PreviousPage.IsCrossPagePostBack = True Then From what I have read, I should be able to just check the PreviousPage property as well, but it always says it is equal to Nothing, even when I have redirected the user to the page from another page. What am I missing
image processing in asp.net   (173 Views)
1) please tell me how we can use script language in master-conten page in asp.net . 2)Describe about sitemap control in asp.net ,i want to add menu item in sitemap control if i add dynamic menu item. 3)My Big Problem is i develop site of image processing in asp.net i drag or select one i,age from collection after drop on other image where need me against i adjust image by crop.resize,and comose both image after i click outer side in asp.net. please replay me.........
T-SQL "recursive" problem   (192 Views)
, I have the following problem. Table: Test Fields: Number int NumberDifference int NumberDate Date the table has fields Number and NumberDate filled. NumberDate column has data values for each day in the calender including weekends. NumberDifference is empty. We need to populate the NumberDifference field with the values that are equal the difference between the values of the Number field for the current NumberDate and the previous NumberDate. ex: Initial table values Number | NumberDifference | NumberDate 1 |_____________________| 01/01/2011 5 |_____________________| 01/02/2011 12 |_____________________| 01/03/2011 15 |_____________________| 01/05/2011 table after the procedure is executed Number | NumberDifference | NumberDate 1 |______1______________| 01/01/2011 5 |______4______________| 01/02/2011 12 |______7______________| 01/03/2011 15 |______3______________| 01/05/2011 I would like to accomplish this task without using cursors or temporary tables.
error CS1502 / CS1503   (250 Views)
I'm doing a simple tutorial for a finance calculator thats in Sams Teah Yourself ASP.net 3.5 in 24 hours, the book is in VB but I'm trying to do it in C#. Here is my code: protected void calculateButton_Click(object sender, EventArgs e) { //Constants, populated at compile time and never change const int interestCalcPerYear = 12; const int paymentsPerYear = 12; //Variables decimal loanValue = Convert.ToInt32(loanAmount.Text); //convert textbox input into int decimal interestValue = (Convert.ToInt32(interestRate.Text)) / 100; //divide rate by 100 int lengthValue = Convert.ToInt32(loanLength.Text); decimal ratePerPeriod; ratePerPeriod = interestValue / interestCalcPerYear; int payPeriods; payPeriods = lengthValue * paymentsPerYear; decimal annualRate; annualRate = Math.Exp(interestCalcPerYear * Math.Log(1 + ratePerPeriod)) - 1; //
Numeric Value Check   (212 Views)
I want to restrict a user to input only numeric value in a text box. In VB we can do it on keypress event. But in ASP.NET for web site page using VB.NET i do't got keypress event on text boxes. Any one help me....
Check Box with Counter   (169 Views)
This is my dilema, I'm rather new at Asp.Net and I'm having trouble running this code. I keep getting a casting errorthat states I can't cast from a number greater than infinatey. I'm trying to get the label to produce a number for the amount of checked CheckBoxes in Asp.Net. Please help if you can.... Protected Sub CheckBoxList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstFruit.SelectedIndexChanged lblcounter.Text = "Your selection count is: " For Each ListItem As CheckBox In lstFruit.Items 'loop for check box If (ListItem.Checked) = True Then 'displays the value in the label lblcounter.Text = CStr((+1)) ' counts the number of boxes checked lblcounter.Text &= ("ListItem.Checked") & "" This is just throughing that error.
Onmouseover Event not Firing...   (295 Views)
Alright, new problem with same problem. Lol. No sense I know, give me a minute. Lol. I'm trying to have the secondary menus, the ones in the HTML after the first ul pop up when you hover over their respected area. When you hover over Products the prodMenu should pop up. Right now I'm not worried about positioning... I just need the menu to pop up. So I put an onmouseover on the li for the ones I need it for. They give a string that is then compared in the Select Case. Which ever matches it's suppose to change the Visibility to true. The way to reverse this is the onmouseout event, but I need the onmouseover to work before I can do that one. If I can figure what's flubbing on this then hopefully when I go to code the out it won't flub then too! Here's the code: Partial Class wucMenu Inherits System.Web.UI.UserControl Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load prodMenu.Visible = False servMenu.Visible = False newsMenu.Visible = False suppMenu.Visible = False compInfoMenu.Visible = False Call Selected() End Sub Protected Sub Hover(ByVal item As String) Select Case item Case Is = "products" prodMenu.Visible = True Case Is = "services" servMenu.Visible = True Case Is = "news" newsMenu.Visible = True Case Is = "support" suppMenu.Visible = True Case Is = "compInfo" compInfoMenu.Visible = True End Select End Sub Public Sub Selected() Dim currentPage As String Dim listItem As HtmlGenericControl currentPage = Request.Url.ToString() If currentPage.StartsWith("http://www.tarheelmedicalbilling.com/") Then 'Works on the site currentPage = currentPage.Replace("http://www.tarheelmedicalbilling.com/", "") ElseIf currentPage.StartsWith("http://tarheelmedicalbilling.com/") Then 'Works if user doesn't put in www. currentPage = currentPage.Replace("http://tarheelmedicalbilling.com/", "") Else 'Works for testing locally currentPage = currentPage.Remove(0, 40) End If Select Case currentPage Case Is = "index.aspx" listItem = liHome Case Is = "products.aspx", "mics.aspx", "nets.aspx", "shiftManager.aspx", "downloads.aspx" listItem = liProduct Case Is = "services.aspx", "billing.aspx" listItem = liServices Case Is = "news.aspx", "press.aspx", "trade.aspx" listItem = liNews Case Is = "feedback.aspx" listItem = liFeedback Case Is = "support.aspx", "supportForm.aspx", "bomgar.aspx" listItem = liSupport Case Is = "companyInfo.aspx", "history.aspx", "employees.aspx", "testimonials.aspx", "contact.aspx" listItem = liCompInfo Case Is = "careers.aspx" listItem = liCareers Case Else Exit Sub End Select listItem.Style("background-image") = "images/menuSelected.gif" listItem.Style("border-color") = "Green" End Sub End Class And here's the page... @import "css/menu.css"; Home Products Services News & Events Inquiry / Feedback Technical Support Company Information Careers MICS Shift Manager NETS Billing Press Release User Conferences & Forums Trade Shows Request Form Bomgar History Employees Testimonials Contact Us I'm not going to give the CSS because I don't think it's necessary. So yeah, that's it.... Please help! I've tried searching online and I don't know what wording to use to find what I need... Help! This post has been edited by Jayman: 30 December 2008 - 03:58 PM
web chat server in c#   (192 Views)
Problem with CrossPage Postback to Display Data from Repeater   (168 Views)
I have a master/Detail page website, where users can select a category of items from a menu. The selected items (from interrogating a SQL database) are displayed in a GridView (on what I called ResultsPage). Using a Repeater control, I also display the brand names (from the selected items), as well as the total number of items for each brand. LinkButton is used to display the brands in a bulleted format. This works fine. Next, I want to enable users to click on the LinkButton which will cause a postback and be directed to another page (which I called a SubsetPage), where the selected brands are displayed in another GridView. The problem is that although a selection of brands is displayed, the total number of brands is incorrect. I guess what happens is the data is lost during postback, or the ViewState is incorrect. I have tried different things without success. Code from the ResultsPage: VB Code from the SubsetPage: Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) If Not Page.IsPostBack Then Dim ConnectionString As String = "Data Source=CYBERSTORE\SQLEXPRESS;Initial Catalog=ProductsDB;Integrated Security=True" Using SqlCon1 As New SqlConnection(ConnectionString) If SqlCon1.State ConnectionState.Open Then SqlCon1.Open() End If Dim BrandSearch As String = Request.QueryString("BrandSearch") Using SqlCom1 As New SqlCommand("ProdProcMSearch", SqlCon1) SqlCom1.CommandType = CommandType.StoredProcedure SqlCom1.Parameters.Add("@Brand", Data.SqlDbType.varchar, 50) GrdMenuSub.DataSource = SqlCom1.ExecuteReader() GrdMenuSub.DataBind() SqlCon1.Close() End Using End Using End If End Sub I will appreciate any suggestion, along with some example code if possible. Please let me know if you require additional information.
MultiView Problem ~~   (173 Views)
now i using MultiView and View, and in my MultiView have 2 View. i have 2 different Webform is login.aspx and admin.aspx, so i want to display in this multiview View1 and View2 . can i do it anyone can help thanks MultiView1View1 - Login.aspxView2 - admin.aspxBest Regard, Windylow World of VB.NET 2005 Since 9/6/2007 Posts 20 Reputation 400 Reply Jos son (Windylow) replied on 11/4/2007 5:14 PM rated by 0 users Thank You ! lmf232 i trying now . :) . if i successful or still have a any question will tell you .Best Regard.
Code not working -RESOLVED   (207 Views)
This might sound stupid but I am a newbie to .NET. How do I make the highlighted section work. I tried putting a textbox on the webpage, named it bExcel and used the value 1 but it did not work. What am I doing wrong' Create a connection and open it. Dim objConn As New System.Data.SqlClient.SqlConnection("User ID=;Password=;Initial Catalog=Northwind;Data Source=SQLServer;") objConn.Open() Dim strSQL As String Dim objDataset As New DataSet() Dim objAdapter As New System.Data.SqlClient.SqlDataAdapter() ' Get all the customers from the USA. strSQL = "Select * from customers where country='USA'" objAdapter.SelectCommand = New System.Data.SqlClient.SqlCommand(strSQL, objConn) ' Fill the dataset. objAdapter.Fill(objDataset) ' Create a new view. Dim oView As New DataView(objDataset.Tables(0)) ' Set up the data grid and bind the data. DataGrid1.DataSource = oView DataGrid1.DataBind() ' Verify if the page is to be displayed in Excel. If Request.QueryString("bExcel") = "1" Then ' Set the content type to Excel. Response.ContentType = "application/vnd.ms-excel" ' Remove the charset from the Content-Type header. Response.Charset = "" ' Turn off the view state. Me.EnableViewState = False Dim tw As New System.IO.StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) ' Get the HTML for the control. DataGrid1.RenderControl(hw) ' Write the HTML back to the browser. Response.Write(tw.ToString()) ' End the response. Response.End() End If
datagrid not showing updates   (187 Views)
I have a button on a web page which outputs the records in the datagrid to a pdf and updates a check box on each row to show it has been printed. After the pdf is output, the sql table is updated and I rebind the datagrid. At that point you cannot see the web page or updated check boxes as the pdf is open over the top of the web page. If I now print the pdf or use the back button to return to my web page the checkboxes are still all blank except the last one in the grid. The table is being updated so how can I return from my pdf and see the updated checkboxes TIA
SP always returns -1   (254 Views)
I've got the following:Code: conn.Open() Dim iCount As Integer iCount = cmd.ExecuteNonQuery() conn.Close() If iCount = 0 Then Return False Else Return True End Ifand in my SP, I have the following:Code:ALTER PROCEDURE dbo.UsersCheckDuplicate_sp ( @UserName nvarchar(256) )ASSET NOCOUNT ONSELECT * FROM aspnet_Users WHERE UserName=@UserNameIF @@ROWCOUNT = 0 RETURN 0ELSE RETURN 1But the SP always returns a -1. When I put my SP in debug, I can see that the SP steps thru' properly thru the code. But eventhough it is supposed to return a 0 or a 1, it always returns a -1 in my VB code.
Two fields in one column in a datagrid   (145 Views)
There is an example on a website with a dropdownlist and a textbox in the same column in the edititemtemplate of a datagrid. The text box is underneath the dropdownlist. However, when I drag a textbox onto my grid it will only position itself alongside the dropdownlist , not underneath it. How do I do this TIA
Where to start in the learning process   (144 Views)
Hi. I have access to a BUNCH of ASP.NET 2.0 videos and I am wondering if it would be fine to start learning asp.net by going through those, or if the technology has changed too much now for those to be relevant. Your opinions
How to create a Mobile Website ?   (169 Views)
I'm in my final year and want to make a project for my last SEM. I decided to make a live project and create a Mobile Website in ASP.NET ( heard ASP.NET is lot simple ) I have no idea about ASP.NET but i'm ok with some programming language like C, C++, JAVA and C# Detail about project Simple Website which would display Mobiles according to the price range and payment only through COD. I don't know CSS. Is this project any Good How much it will take Without CSS can i make this project While creating a new project it ask for select language C# OR Visual Basic which one should i select and why I have some knowledge in Visual Basic. Please help and
Cookies in ASP.NET   (210 Views)
Quick question. I am changing over the secure areas of all of our websites into a single URL (secure.mycompany.com), but the way things are set up now is that when, say, a user logs in on our site, the cookie is made on a different web site (example: theproduct.com). We have a function on the secure page that checks to see if the cookie is there, and if it isn't then it doesn't display certain information properly. Is there anyway for the other web site (the secure one) to find and use the cookie that the product's website created If not, I may just move the login pages over and put those on the secure page as well if necessary.
User Login and Roles   (208 Views)
I am just starting to work with Web Forms and am looking for a way to have user authentication only when a user choses to login, and to have user roles give them access to post, edit, delete, or a combination of those. I have the Wrox book - Beginning ASP.Net with VB.Net and it doesn't go into enough detail on this subject.If it is simple enough for someone to zip a project/solution file I would appreciate it...If not please recommend some good books/sources of information
open port attached with gsm modem in asp.net   (196 Views)
Hi I wanted to develop a web application using asp.net. I wanted code to open the port which was attached by a GSM Modem Advance
simple type question   (170 Views)
what is the true type of y in c# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Entity { public class TSMM { public int x { get; set; } public timestamp y { get; set; } [b]// what is the true type (instead of timestamp) of y in c#[/b] public DateTime z { get; set; } public float t { get; set; } public int u { get; set; } public int v { get; set; } } }
How to capture logout time in global.asax?   (189 Views)
I need to capture the logout time and save it into the database. The logout time for the user need to be corresponding with the login time of that same user. As there can be many other users online at the same time. I cannot capture the logout time and I cannot tell where I had done wrongly. There is no error message when I debug. Can someone help me with it The coding I have now is, eg Sam has many logged in time so it should have many different logged out time but my current logged out time is the same for all Sam's logged in time. I'm doing in global.asax protected void Session_Start(object sender, EventArgs e) { //code that runs when a new session is started Session.Timeout = 1; } protected void Session_End(object sender, EventArgs e) { string emailaddress = (string)Session["emailaddress"]; UpdateLoggedInUsersLogoutTime(emailaddress); Session.Abandon(); Session.Clear(); } protected Boolean UpdateLoggedInUsersLogoutTime(string emailaddress) { SqlConnection connection = null; SqlCommand command = null; Boolean successFlag = false; try { string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; connection = new SqlConnection(connectionString); connection.Open(); //retrieve the logid SqlCommand cmd = new SqlCommand("SELECT TOP 1 LogId FROM LoggedInUsers where MemberID = @MemberID ORDER BY LogId DESC"); //pass the session int logid = (int)Session["MemberId"]; //update record based on logid SqlCommand cmd1 = new SqlCommand("UPDATE LoggedInUsers set LogoutTime = @LogoutTime Where LogId = @LogId"); //prepare sql statements string sql = "UPDATE LoggedInUsers set LogoutTime=@LogoutTime where emailaddress=@EmailAddress"; //Response.Write(sql + ""); command = new SqlCommand(sql, connection); command.Parameters.Clear(); command.Parameters.AddWithValue("@LogoutTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); command.Parameters.AddWithValue("@EmailAddress", emailaddress); int rowCount = command.ExecuteNonQuery(); if (rowCount != 0)
What is this?   (110 Views)
In the picture below, can anyone tell me what the bar is between my header and my navigation menu I was wanting to change the color of it to match my site, but I can't figure out what it is.
Accessing HTML Element through ASP.NET C#   (181 Views)
I want to access a element through ASP.Net Page_Load event. if user is authenticated { access div tag and hide it access div tag and replace it with new div tag }
Dynamic control type and ID   (268 Views)
I'm trying to create dynamic controls which type and ID depends on some row data retrieved from a database.For example if the data column "productType" is "1", then create a textbox with ID the same as the column "productID".I've tried using a Repeater. But the problem is there seems to be no way to retrieve the value of a particular field to a variable (instead of a data-binding element) and then set the ID of the textbox as the control is rendered. I searched around and seems like most solutions point to iterating the repeater, finding the control, and then setting the properties.. but it won't work in this case because I'm not sure how to find the appropriate control in the first place
detailview delete store procedure   (209 Views)
I have a gridview with sqldatasource and the insert, update and delete set up. of them are calling a store procedure.the insert and update work fine, but the delete blow me an exception : Procedure or function has too many arguments specified.In my aspx source view, I have which is the exact parameter I need for the stored procedure.This is killing me.Can someone help me
Get the current page   (186 Views)
HiIs it possible to get the current page (being processed) from a module I know its possible to get stuff like the current context, etc but i need to be able to perform a findcontrol on the page.I could put the functionality in a class, but as far as i see it i would have the same problem. Also, i dont want to pass the current page to the function I have written.I would appreciate any thoughts,
Considering to use placeholder to display data from the database   (142 Views)
,I am designing the page in which the details of an Offer (after clicking in some Offer line) will be displayed. This page will execute a query to the database and will contain tables of data that sometimes, some of them, will not appear, and the same with some of the tables rows.My question is: Which is the best control to use so that when some parts of the page are not, the rest of the parts are displayed normally without blank spaces between them I mean hiding the parts where there are not data.I am thinking in PlaceHolder, Is this the best control to use when rendering variable data in a pageThank you,Cesar
mulitsectional display on webform   (157 Views)
ASP.net Visual Studio.net WebformI would like to display a textbox based on the True False value of a checkbox. The things I have tried have not been successful.I would then like to go one step farther, and display a "sectional" form, based on user choice.CODEPublic Sub CheckBox1_Checked(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged"DISPLAY TEXTBOX 1" End SubPublic Sub CheckBox2_Checked(ByVal sender As Object, ByVal e As EventArgs) Handles CheckBox2.CheckedChanged"DISPLAY TEXTBOX 2" End Sub
print page   (187 Views)
Is there a way to print page in asp.net Like how javascipt can print page.
Browsing the Clients FileSystem   (166 Views)
My task is to design an Upload form which allows the user to chose some files on his machine and upload them to the server.Now I know using ASP.NET you can use the HTMLInputFile Control to do this. But my boss doesn't want the default Load File Dialog to open. He wants an aspx page which would allow browsing the file system just like in explorer. i.e. on the left you have the folders and on the right the files.So does anyone have an idea on how to do that I couldn't find anything usefu
DataGrid not showing...   (181 Views)
I'm new at all this but have spent several hours going through many many examples of doing a simple hook up to a data grid in Studio.NET.The grid never appears in browser mode; everything is perfectly set up; cnn, adapter, dataset, Grid parameters;any ideas
Adding a newline in a string.   (226 Views)
I am trying to create a mail message body, that will give me multiple lines... I tried this:msgBody += Session("Name") & " (" & Session("id") & ") has ordered the following Supplies." & CHR(10) & CHR(13)if candid.Text "" then msgBody += candid.Text & " Candid Envelopes." & CHR(10) & CHR(13)if senior.Text "" then msgBody += senior.Text & " Senior Envelopes." & CHR(10) & CHR(13)It worked at first, but now everything goes on the same line.(Actually, at first I had only CHR(10), but now that doesn't even work.)How can I create something that gives me multiple lines
How to do a complete search   (214 Views)
I have a page for our customer to search the jobs for advertised currently and works great when the use a single word. example when the search for "Bituminous" job they get the result However if they enter into the search text box like this "Bituminous and Overlay" then they do not get anything back eventhough there is an a project for Bituminous and overlay job..how can I modify my code to do such kind of search thank you for the help With strStringBuilder .... .Append(" AND UPPER (get_desc (p.contid)) LIKE :curJobSearch ") .Append(" ORDER BY l.lcontid ") End With Dim cmdJobSearch As OracleCommand = New OracleCommand cmdJobSearch.Parameters.Add(":curJobSearch", OracleType.Char).Value = "%" & Trim(curJobType).ToUpper & "%" cmdJobSearch.Connection = oOracleConn
Sporadic error message   (233 Views)
Hi all,I have about 5 aspx pages in my root directory. For most part these application run without any problem but sometimes I get this sporadic error message and none of the 5 aspx pages apps. are working after I click to the apps so many times the application will start working again.So every time I have this error I have to click one of the apps numerous times inorder to make the apps get to work. Do you have any clue why all of them at the same time show an error message.will this error caused because the web.config file is corrupted or something else. I do not have the access to see the error message from the log event page...please point me to the right direction.Thank you
New to ASP.NET - Update SQL Data   (217 Views)
I am new to ASP.NET and would appreciate help.This is a description of my page...A dropdown is loaded with a list of states.A 2nd dropdown is loaded with a list of sales reps (from SQL).When a state is selected, the datagrid lists each county and the current sales rep assigned (SQL Query).When the user selects a sales rep from the 2nd dropdown, all of the reps in the datagrid are changed.The Update button should take the data in the grid and update the original SQL source.The Update button is what I don't know how to do.Do I create a DataAdapter at design time, store the data from the grid in an array, create another DataSet filled by the array, then update with the grid DataSet Is it possible for someone to post codeI have it so that I can loop through the grid records and call a stored procedure each time, but this is not what I want to do. I want to use a DataAdapter correctly - but need help understanding how.If anyone has suggestions, or advice on what I should read up on, please let me know
trimming data in hyperlink field on gridview   (162 Views)
I have a hyperlink field which is populated by an underlying field called CompanyName. When the gridview is rendered, then the company name shows up as a link, as it should. The problem is that I want to force the ui to display only the first 25 characters. Right now if there are more, it wraps, and I don't want that. Now the following code works to trim data in non-hyperlinked fields:CODE Protected Sub myGridView_RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then If Len(e.Row.Cells(1).Text) > 25 Then e.Row.Cells(1).Text = Left(e.Row.Cells(1).Text, 25) End If End IfHow do you do this kind of thing when it's a hyperlink field
Visual Web Developer not opening .vbproj file   (171 Views)
If anyone if familiar with Visual Web Developer... I am unable to open an existing VS.NET 2005 solution that contains .vbproj files. It complains that .vbproj software is not installed. What could be causing thi
GridView problems   (298 Views)
1.) Yes.. Use Try catch blocks to handle your errors.2.)Quote:Is this because I have the edit/delete columns generated Yes.3.)Try using the Row_Updating event.
unicode mail by .Net   (232 Views)
i want to send an email by .net C# as UTF-8, so i did as following MailMessage myMail=new MailMessage();myMail.To=Request.Form("ToText");myMail.FromRequest.Form("FromText");myMail.BodyFormat=MailFormat.Html;myMail.Body=Request.Form("BodyText");; myMail.Subject="Polling";myMail.BodyEncoding=MailEncoding.Base64;SmtpMail.SmtpServerSmtpServer;SmtpMail.Send(myMail); but it gives this error on compiling"Cannot implicitly convert type 'System.Web.Mail.MailEncoding' to "System.Text.Encoding'" on linemyMail.BodyEncoding=MailEncoding.Base64;what is it
View files from another server   (234 Views)
I have a storage server(NAS) within my domain. it contains nothing but pdf files. I am trying to build a form that will show all the files listed and I want them available for download. I know I need to use the FSO but how do I connect to that other server within my form If I give aspnet account access to that server will that be enoughany help or examples would be appreciate