Search Results

Search found 19688 results on 788 pages for 'con current'.

Page 87/788 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • WPF Dispatcher {"The calling thread cannot access this object because a different thread owns it."}

    - by user359446
    first I need to say that I´m noob with WPF and C#. Application: Create Mandelbrot Image (GUI) My disptacher works perfektly this this case: private void progressBarRefresh(){ while ((con.Progress) < 99) { progressBar1.Dispatcher.Invoke(DispatcherPriority.Send, new Action(delegate { progressBar1.Value = con.Progress; } )); } } I get the Message (Title) when tring to do this with the below code: bmp = BitmapSource.Create(width, height, 96, 96, pf, null, rawImage, stride); this.Dispatcher.Invoke(DispatcherPriority.Send, new Action(delegate { img.Source = bmp; ViewBox.Child = img; //vllt am schluss } )); I will try to explain how my program works. I created a new Thread (because GUI dont response) for the calculation of the pixels and the colors. In this Thread(Mehtod) I´m using the Dispatcher to Refresh my Image in the ViewBox after the calculations are ready. When I´m dont put the calculation in a seperate Thread then I can refresh or build my Image.

    Read the article

  • I can't Open my excel file in c#

    - by Ruben Guico
    Hi, Below is my code, i tried to open my excel file in my c# application but the program give's me an error message "Cannot Access "my excel.xls". But when I specify the file path in my string path variable it works, the problem is I need to get the file path from an openFileDialog. using System; using System.IO; using System.Collections.Generic; using System.Text; using System.Data; using System.Windows.Forms; using System.Data.OleDb; using System.Reflection; using MOIE = Microsoft.Office.Interop.Excel; using OFFICE = Microsoft.Office.Core; namespace EmpUploader { public class ExcelCon { private OleDbDataReader reader = null; private OleDbCommand excelCommand = new OleDbCommand(); private OleDbDataAdapter adapter = new OleDbDataAdapter(); private DataTable excelData = new DataTable(); private MOIE.ApplicationClass objExcel = new MOIE.ApplicationClass(); private MOIE.Workbook wb = null; private string myConn = ""; private string strSQL = ""; private string err = ""; private string path2 = ""; private int sheetCount = 0; private OleDbConnection Con = new OleDbConnection(""); #region "excel interop prarameters" private static object xl_missing = Type.Missing; private static object xl_true = true; private static object xl_false = false; private object xl_update_links = xl_missing; private object xl_read_only = xl_missing; private object xl_format = xl_missing; private object xl_password = xl_missing; private object xl_write_res_password = xl_missing; private object xl_ignore_read_only = xl_missing; private object xl_origin = xl_missing; private object xl_delimiter = xl_missing; private object xl_editable = xl_missing; private object xl_notify = xl_missing; private object xl_converter = xl_missing; private object xl_add_to_mru = xl_missing; private object xl_local = xl_missing; private object xl_corrupt_load = xl_missing; #endregion } //MY CODE FOR OPENING THE EXCEL //note that my file path came from an openfiledialog public void InitializeConnection(string path) { //connection string for excel myConn = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + path + "; Extended Properties =Excel 8.0"; Con.ConnectionString = myConn; Con.Open(); //this is the sample specified path that worked when i test my application //path = @"C:\shinetsu p5 emp list.xls"; objExcel.Visible = false; wb = objExcel.Workbooks.Open(path, xl_update_links, xl_read_only, xl_format, xl_password, xl_write_res_password, xl_ignore_read_only, xl_origin, xl_delimiter, xl_editable, xl_notify, xl_converter, xl_add_to_mru, xl_local, xl_corrupt_load); sheetCount = wb.Worksheets.Count; } }

    Read the article

  • php writing array in a text file fails, why?

    - by Tarique Imam
    trying to write an array to a text file, but it is failed, can anybody say, WHY? $filename= 't12a'; for ($pnum = 1; $pnum <= 15; $pnum++){ $bbal = 3; $ipmnt = 14 * 5; $ppmnt = 26 - 7; $ebal = 48 - 4; $ccint = 54 + 45; $cpmnt = 25 + 54; $db_data_txt[] = array('pn' => $pnum, 'bb' => sprintf("%01.2f",$bbal),'ip'=>sprintf("%01.2f",$ipmnt),'pp'=>sprintf("%01.2f",$ppmnt),'eb'=>sprintf("%01.2f",$ebal),'ci'=>sprintf("%01.2f",$ccint),'cp'=>sprintf("%01.2f",$cpmnt)); } $con= $db_data_txt; if ( ! write_file("./files/{$filename}.doc", $con)) { echo 'Unable to write the file'; } else { echo 'File written!'; }

    Read the article

  • pass an ID with hyperlik but cant get this ID value from a fk in one table when i click in insert

    - by susan
    Something strange happened in my codes, actually I have a hyperlink that pass ID value in a query string to second page.in second page i have 2 sql datasource that both these sql datasources should get this id value and pass it to a filter parameter to show sth in datalist. so in another word I have a first page that has an hyperlink read ID value from a datasource and pass it to second page.its like below: <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/forumpage.aspx?ID="+Eval("ID")%>'><%#Eval("title")%> </asp:HyperLink> then in second page i have one sql datasource with a query like this ...where ID=@id and get this id in query string from db.it work great . but i have problem with second sql datasource in second page it has a query sth like below:...forms.question_id=@id then in sql reference both to query string as ID that get by first page in hyperlink. but when i click in insert button show me error with fk. error:Error:The INSERT statement conflicted with the FOREIGN KEY constraint "FK_forumreply_forumquestions". The conflict occurred in database "forum", table "dbo.forumquestions", column 'ID'. The statement has been terminated. my tables (question(ID,user_id(fk),Cat_id(fk),title,bodytext) (reply(ID,userr_id(fk),questionn_id(fk),titlereply,bodytestreply); When by hand in cb i gave a number in questionn_id like 1 it show me successful but when it want read from a filter by datasource this field face with problem. plzzzz help i really need skip from this part.and cause i am new i guess I cant understand the logic way clearly. <asp:SqlDataSource ID="sdsreply" runat="server" ConnectionString="<%$ ConnectionStrings:forumConnectionString %>" SelectCommand="SELECT forumreply.ID, forumreply.userr_id, forumreply.questionn_id, forumreply.bodytextreply, forumreply.datetimereply, forumquestions.ID AS Expr1, forumusers.ID AS Expr2, forumusers.username FROM forumquestions INNER JOIN forumreply ON forumquestions.ID = forumreply.questionn_id INNER JOIN forumusers ON forumquestions.user_id = forumusers.ID AND forumreply.userr_id = forumusers.ID where forumreply.questionn_id=@questionn_id"> <SelectParameters> <asp:QueryStringParameter Name="questionn_id" QueryStringField="ID" /> </SelectParameters> </asp:SqlDataSource> it is cb for second page in insert button: { if (Session["userid"] != null) { lblreply.Text = Session["userid"].ToString(); } else { Session["userid"]=null; } if (HttpContext.Current.User.Identity.IsAuthenticated) { lblshow.Text = string.Empty; string d = HttpContext.Current.User.Identity.Name; lblshow.Text =d + "???? ??? ?????." ; foreach (DataListItem item in DataList2.Items) { Label questionn_idLabel = (Label)item.FindControl("questionn_idLabel"); Label userr_idLabel = (Label)item.FindControl("userr_idLabel"); lbltest.Text = string.Empty; lbltest.Text = questionn_idLabel.Text; lblreply.Text = string.Empty; lblreply.Text = userr_idLabel.Text; } } else { lblshow.Text = "??? ??? ??? ??? ?? ?? ?????? ???? ???? ???? ????? ??? ??? ? ??? ????? ???????."; } } { if(HttpContext.Current.User.Identity.IsAuthenticated) { if (Page.IsValid) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["forumConnectionString"].ConnectionString); try { con.Open(); SqlCommand cmd = new SqlCommand("insert into forumreply (userr_id,questionn_id,bodytextreply,datetimereply)values(@userr_id,@questionn_id,@bodytextreply,@datetimereply)", con); cmd.Parameters.AddWithValue("userr_id",lblreply.Text); cmd.Parameters.AddWithValue("questionn_id",lbltest.Text); cmd.Parameters.AddWithValue("bodytextreply",txtbody.Text); cmd.Parameters.AddWithValue("datetimereply",DateTime.Now ); cmd.ExecuteNonQuery(); } catch (Exception exp) { Response.Write("<b>Error:</b>"); Response.Write(exp.Message); } finally { con.Close(); } lblmsg.Text = "???? ??? ?? ?????? ??? ?????.thx"; lblshow.Visible = false; //lbltxt.Text = txtbody.Text; txtbody.Text = string.Empty; } } else { lblmsg.Text = string.Empty; Session["rem"] = Request.UrlReferrer.AbsoluteUri; Response.Redirect("~/login.aspx"); } }

    Read the article

  • How to Post Javascript to a MySQL Database

    - by salientanimal
    Hi guys, I have created a form in HTLM and I m trying to post the information in the form to a MySQL database. My form make suse of a dynamic list selection that needs to be captured to the database. However when submtting the form I get the following error Error: Unknown column 'coulmn_name' in 'field list'. Here is my HTML CODE for the form <td height="94"><p align="justify">CALL TRACKER - ADMIN</p></td> Customer Name : E-Mail Address : </tr> <tr> <td width="29%" align="right" valign="middle"><strong>Case Number :</strong></td> <td> <input type="text" name="case_number" width="70%" align="left" valign="middle"> </td> </tr> <tr> <td width="29%" align="right" valign="middle"><strong>MSISDN :</strong></td> <td> <input type="text" name="msisdn" width="70%" align="left" valign="middle"> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Route Cause :</strong></td> <td width="71%" align="left" valign="middle"> <select name="route_cause" id="category" onChange="javascript: listboxchange1(this.options[this.selectedIndex].value);"> <!-- <select name="route_cause" id="route_cause"> --> <option value="">Select the Call Reason</option> <option value="Billing Admin">Billing Admin</option> <option value="Customer Care">Customer Care</option> <option value="Insurance">Insurance</option> <option value="Repairs">Repairs</option> <option value="SIM Swap">SIM Swap</option> <option value="UTI">UTI</option> </select> </td> </tr> <tr> <td align="right" valign="middle"> <strong>Call Type/Indexed To :</strong></td> <td align="left" valign="middle"> <script type="text/javascript" language="javascript" name="calltype_indexedto"> <!-- document.write('<select name="subcategory1" onChange="javascript: listboxchange2(this.options[this.selectedIndex].value);"><option value=""></option></select>') --> </script> </td> </tr> <tr> <td align="right" valign="middle"> <strong>Type/TAT :</strong></td> <td align="left" valign="middle"> <script type="text/javascript" language="javascript" name="type_tat"> <!-- document.write('<select name="subcategory2" onChange="javascript: listboxchange3(this.options[this.selectedIndex].value);"><option value=""></option></select>') --> </script> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Escalated To :</strong></td> <td width="71%" align="left" valign="middle"> <select name="escalatedto" id="escalated_to"> <option value="">Select the Escalation</option> <option value="Billing Ops">Billing Ops</option> <option value="Resolvers">Resolvers</option> <option value="Finance">Finance</option> <option value="Ressolver">Ressolver</option> <option value="Nudebt">Nudebt</option> <option value="Transunion">Transunion</option> <option value="N/A">N/A</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Requested By :</strong></td> <td width="71%" align="left" valign="middle"> <select name="requestedby" id="requested_by"> <option value="">UTI Requested By</option> <option value="Billing">Billing</option> <option value="Customer Service">Customer Service</option> <option value="Insurance">Insurance</option> <option value="Management">Management</option> <option value="Repairs">Repairs</option> <option value="Retail Support">Retail Support</option> <option value="Retentions">Retentions</option> <option value="SIM Swap">SIM Swap</option> <option value="WOW">WOW</option> <option value="N/A">N/A</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"> <strong>Province :</strong></td> <td width="71%" align="left" valign="middle"> <select name="province" id="province"> <option value="">Select the Province</option> <option value="Eastern Cape">Eastern Cape</option> <option value="Gauteng">Gauteng</option> <option value="Kwa-Zulu Natal">Kwa-Zulu Natal</option> <option value="Limpopo">Limpopo</option> <option value="Mpumalanga">Mpumalanga</option> <option value="North West">North West</option> <option value="Northern Cape">Northern Cape</option> <option value="Polokwane">Polokwane</option> <option value="Western Cape">Western Cape</option> <option value="Other">Other</option> </select> </td> </tr> <tr> <td width="29%" align="right" valign="middle"><strong>Comments :</strong></td> <td> <textarea rows ="5" cols="30" name="comments"> </textarea> </td> </tr> <tr> <td> <p> <input type="reset" value="Reset Form"><input type="Submit" value="Submit"> Here is my PHP CODE to write to the Database <?php $con = mysql_connect("hostname" ,"mysqusername" ,"mysqlpassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $con); $sql="INSERT INTO customer_services_tracker (customer_name ,customer_email_address ,case_number ,msisdn ,route_cause ,calltype_indexedto ,type_tat ,escalatedto ,requestedby ,province ,comments ) VALUES ('$_POST[customer_name]' ,'$_POST[customer_email_address]' ,'$_POST[case_number]' ,'$_POST[msisdn]' ,'$_POST[route_cause]' ,'$_POST[calltype_indexedto]' ,'$_POST[type_tat]' ,'$_POST[escalatedto]' ,'$_POST[requestedby]' ,'$_POST[province]' ,'$_POST[comments]')"; $CatName = $rowCat["Name"]; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?>

    Read the article

  • radgridview delete update in asp.net

    - by abhi
    i have written the follwing to display data from the datagrid and den insert new rows but how do i perform update and delete plss help here's my code using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using Telerik.Web.UI; using System.Data.SqlClient; public partial class Default6 : System.Web.UI.Page { string strQry, strCon; SqlDataAdapter da; SqlConnection con; DataSet ds; protected void Page_Load(object sender, EventArgs e) { strCon = "Data Source=MINETDEVDATA; Initial Catalog=ML_SuppliersProd; User Id=sa; Password=@MinetApps7;"; con = new SqlConnection(strCon); strQry = "SELECT * FROM table1"; da = new SqlDataAdapter(strQry, con); SqlCommandBuilder cmdbuild = new SqlCommandBuilder(da); ds = new DataSet(); da.Fill(ds, "table1"); RadGrid1.DataSource = ds.Tables["table1"]; RadGrid1.DataBind(); Label3.Visible = false; Label4.Visible = false; Label5.Visible = false; txtFname.Visible = false; txtLname.Visible = false; txtDesignation.Visible = false; } protected void Submit_Click(object sender, EventArgs e) { Label3.Visible = true; Label4.Visible = true; Label5.Visible = true; txtFname.Visible = true; txtLname.Visible = true; txtDesignation.Visible = true; } protected void Button2_Click(object sender, EventArgs e) { DataSet ds = new DataSet("EmployeeSet"); da.Fill(ds, "table1"); DataTable EmployeeTable = ds.Tables["table1"]; DataRow row = EmployeeTable.NewRow(); row["Fname"] = txtFname.Text.ToString(); row["Lname"] = txtLname.Text.ToString(); row["Designation"] = txtDesignation.Text.ToString(); EmployeeTable.Rows.Add(row); da.Update(ds, "table1"); //RadGrid1.DataSource = ds.Tables["table1"]; //RadGrid1.DataBind(); txtFname.Text = ""; txtLname.Text = ""; txtDesignation.Text = ""; } protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e) { } } }

    Read the article

  • ADO.NET: Faster way to check if the database server is accessible?

    - by lotana
    At the moment I am using this code to check if the database is accessible: public bool IsDatabaseOnline(string con) { bool isConnected = false; SQLConnection connect = null; try { connect = new SQLConnection(con); connect.Open(); isConnected = true; } catch (Exception e) { isConnected = false; } finally { if (connect != null) connect.Close(); } return isConnected; } While this code works fine, there is a disadvantage. If the server is not online it spends about 4 full seconds trying to open the connection before deciding that it is not available. Is there a way to test the connection without trying to actually opening it and waiting for the timeout? Something like a database-equivalent of ping?

    Read the article

  • How to add external jar...through URL..using .classpath??

    - by Rahul
    **In any javaProject in eclipse there we always get .classpath file...like <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry path="ABC/junit" kind="src"/> <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/> <classpathentry path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4" kind="con"/> <classpathentry path="targets" kind="output"/> </classpath> Here when we import any external jar it is giving path of that jar in classpathentry...i want that classpathentry should be from any URL which will provide that external jar...can anyone plz tell me how to do that..actually i want to add external jar automatically from URL(any) when user will import that project in eclipse..i don't want user will manually add external jars..i want to make change .classpath accordingly. Or anyother way to do this automatically. Please help me...Waiting for reply.**

    Read the article

  • please help me to find out where i am doing mistake in this code? i wnat retieve the value that i am

    - by user309381
    function reload(form) { var val = $('seltab').getValue(); new Ajax.Request('Website.php?cat=' +escape(val), { method:'get', onSuccess: function(transport){ var response = transport.responseText ; $("MyDivDB").innerHTML = transport.responseText ; alert("Success! \n\n" + response); }, onFailure: function(){ alert('Something went wrong...') } }); } </script> </head> title author pages $con = mysql_connect($dbhostname,$dbuserid,$dbpassword); if(!$con) { die ("connection failed".mysql_error()); } $db = mysql_select_db($dbname,$con); if(!$db) { die("Database is not selected".mysql_error()); } $query ="SELECT * FROM books NATURAL JOIN authors" ; $result = mysql_query($query); if(!$query) { die("Database is not query".mysql_error()); } while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { $title = $row["title"]; $author = $row["author"]; $page = $row["pages"]; echo "<tr>"; echo "<td>$title</td>"; echo "<td>$author</td>"; echo "<td>$page</td>"; echo "</tr>"; } print "</table>"; echo "<select id = seltab onchange = 'reload(this.form)'>"; $querysel = "SELECT title_id,author FROM authors NATURAL JOIN books"; $result1 = mysql_query($querysel) ; while($rowID = mysql_fetch_assoc($result1)) { $TitleID = $rowID['title_id']; $author = $rowID['author']; print "<option value = $author>$author\n"; print "</option>"; } print "</select>"; ? Wbsite.php

    Read the article

  • How to make a thread try to reconnect to the Database x times using JDBCTemplate

    - by gillJ
    Hi, I have a single thread trying to connect to a database using JDBCTemplate as follows: JDBCTemplate jdbcTemplate = new JdbcTemplate(dataSource); try{ jdbcTemplate.execute(new CallableStatementCreator() { @Override public CallableStatement createCallableStatement(Connection con) throws SQLException { return con.prepareCall(query); } }, new CallableStatementCallback() { @Override public Object doInCallableStatement(CallableStatement cs) throws SQLException { cs.setString(1, subscriberID); cs.execute(); return null; } }); } catch (DataAccessException dae) { throw new CougarFrameworkException( "Problem removing subscriber from events queue: " + subscriberID, dae); } I want to make sure that if the above code throws DataAccessException or SQLException, the thread waits a few seconds and tries to re-connect, say 5 more times and then gives up. How can I achieve this? Also, if during execution the database goes down and comes up again, how can i ensure that my program recovers from this and continues running instead of throwing an exception and exiting?

    Read the article

  • Is wrapping new within the constructor good or bad?

    - by Timothy
    I watched John Resig's Best Practices in JavaScript Library Design presentation; one slide suggested "tweaking" the object constructor so it instantiates itself. function jQuery(str, con) { if (window === this) { return new jQuery(str, con); } // ... } With that, new jQuery("#foo") becomes jQuery("# foo"). I thought it was rather interesting, but I haven't written a constructor like that in my own code. A little later I read a post here on SO. (Sorry, I don't remember which or I'd supply a link. I will update the question if I can find it again.) One of the comments said it was bad practice to hide new from the programmer like that, but didn't go into details. My question is, it the above generally considered good, bad, or indifferent, and why?

    Read the article

  • drop down list had zero value

    - by KareemSaad
    I had ddl which in selected changed it execute some code but when i tried to do that it wasn't worked well WHEN i checked the reason i found that ddl in selected value =0 also i made all well and this is my code protected void DDlProductFamily_SelectedIndexChanged(object sender, EventArgs e) { if (DDlProductFamily.DataValueField.Contains("ProductCategory_Id")) using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductCategory", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", DDlProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } }

    Read the article

  • Single Query returning me 4 tables, How to get all of them back into dataset ?

    - by Shantanu Gupta
    How to fill multiple tables in a dataset. I m using a query that returns me four tables. At the frontend I am trying to fill all the four resultant table into dataset. Here is my Query. Query is not complete. But it is just a refrence for my Ques Select * from tblxyz compute sum(col1) suppose this query returns more than one table, I want to fill all the tables into my dataset I am filling result like this con.open(); adp.fill(dset); con.close(); Now when i checks this dataset. It shows me that it has four tables but only first table data is being displayed into it. rest 3 dont even have schema also. What i need to do to get desired output

    Read the article

  • sql query in the SqlDataAdapter()

    - by syedsaleemss
    Im using c# .net windows form application. I have loaded names of all the tables present in a database into a combobox. Now i need to display the contents of the selected table name. Normally we use SqlDataAdapter adp= new SqlDataAdapter("Select * from employee", con); This works fine. but instead of explicitly giving table name i.e employee i need to set it to combobox1.selected item. I have given like this its not working: string filename= combobox1.selecteditem; SqlDataAdapter adp= new SqlDataAdapter("Select * from filename", con); How can I select filename dynamically?

    Read the article

  • display image in image control

    - by KareemSaad
    I had Image control and I added code to display images But there is not any image displayed ASPX: <body> <form id="form1" runat="server"> <div dir='<%= sDirection %>'> <div id="ContentImage" runat="server"> <asp:Image ID="Image2" runat="server" /> </div> </div> </form> </body> C#: using (System.Data.SqlClient.SqlConnection con = Connection.GetConnection()) { string Sql = "Select Image From AboutUsData Where Id=@Id"; System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand(Sql, con); com.CommandType = System.Data.CommandType.Text; com.Parameters.Add(Parameter.NewInt("@Id", Request.QueryString["Id"].ToString())); System.Data.SqlClient.SqlDataReader dr = com.ExecuteReader(); if (dr.Read() && dr != null) { Image1.ImageUrl = dr["Image"].ToString(); } }

    Read the article

  • Visual Studio 2008 (C#) with SQL Compact Edition database error: 26

    - by Tommy
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) I've created a SQL compact database, included it in my application, and can connect to the database fine from other database editors, but within my application im trying using (SqlConnection con = new SqlConnection(Properties.Settings.Default.DatabaseConnection)) { con.Open(); } the connection string is Data Source=|DataDirectory|\Database.sdf I'm stumped, any insight?

    Read the article

  • How to connect 2 mysql tables with 2 connection string

    - by denonth
    Hi all I need to connect 2 tables from 2 mysql databases that have 2 different connection strings and each is on the different server. I have this query: cmd = new MySqlCommand(String.Format("INSERT INTO {0} (a,b,c,d) SELECT (a,b,c,d) FROM {1}", ConfigSettings.ReadSetting("main_table"), ConfigSettings.ReadSetting("main_table")), con); So both table have the same columns. Thats why I have only one ConfigSettings.ReadSetting("main_table") for both of them as they are same. I have 2 connection strings and each is pointing to their server: con.ConnectionString = ConfigurationManager.ConnectionStrings["con1"].ConnectionString; con2.ConnectionString = ConfigurationManager.ConnectionStrings["con2"].ConnectionString; How to make this cmd to be workking with 2 different connection strings and with the same name for the table. Table name will change that's why it is saved in config.

    Read the article

  • Getting value from a texbox in asp.net

    - by user279521
    Hi, I have a web page which contains multiple panels (used to show and hide various textboxes) and one particular panel contains textboxes that is used to edit records. However, when I am attemtping to update the table, the txtVendorID.Text.Trim() is blank. SqlConnection con = new SqlConnection(strConn); string sqlUpdateVendor = "usp_Vendor_Update"; SqlCommand cmdUpdateVendor = new SqlCommand(sqlUpdateVendor, con); cmdUpdateVendor.CommandType = CommandType.StoredProcedure; cmdUpdateVendor.Parameters.Add(new SqlParameter("@RecID", SqlDbType.VarChar, 50)); cmdUpdateVendor.Parameters["@RecID"].Value = Request.QueryString["Rec_ID"]; cmdUpdateVendor.Parameters.Add(new SqlParameter("@empid", SqlDbType.VarChar, 11)); cmdUpdateVendor.Parameters["@empid"].Value = txtEmpIDNumber.Text.Trim(); cmdUpdateVendor.Parameters.Add(new SqlParameter("@VendorName", SqlDbType.VarChar, 100)); cmdUpdateVendor.Parameters["@VendorName"].Value = txtVendorName.Text.Trim(); Any idea why the textbox does not contain a value?

    Read the article

  • User Controls Importing Problem (asp.net)(vb)

    - by Phil
    I have this class that contains vars for db connection; Public Shared s As String Public Shared con As String = WebConfigurationManager.ConnectionStrings("foo").ToString() Public Shared c As New SqlConnection(con) Public Shared x As New SqlCommand(s, c) I import this to my page like this; Imports DBVars I'm then able to access these vars from my page. But if I try to import them into a user control the variables are not available. Am I making an error or is this expected? Thanks.

    Read the article

  • dropdown list selected index changed

    - by KareemSaad
    I did my drop down list that get it,s values from database and when run the application it didnot work and compiler didnot see the code onselectedindexchanged="DDlProductFamily_SelectedIndexChanged" protected void DDlProductFamily_SelectedIndexChanged(object sender, EventArgs e) { using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("SelectThumbByProductFamily", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", DDlProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } }

    Read the article

  • Assign value to HTML textbox from JSP

    - by prakash_d22
    Hello I am creating a web page to add some information about given product.I need to enter id,name,description and image as information.I need the id to be auto generated.I am using jsp and database as access.I am fetching the count(*)+1 value from database and assigning to my html text box but its showing as null.can i get some help? Code: <body> <%@page import="java.sql.*"%> <%! String no; %> <% try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:pd"); ResultSet rs = null; Statement st = con.createStatement(); String sql = ("select count(*)+1 from products"); st.executeUpdate(sql); while (rs.next()) { no=rs.getString("count(*)+1"); } rs.close(); st.close(); con.close(); } catch(Exception e){} %> <Form name='Form1' action="productcode.jsp" method="post"> <table width="1024" border="0"> <tr> <td width="10">&nbsp;</td> <td width="126">Add Product: </td> <td width="277">&nbsp;</td> <td width="583">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>Product Id:</td> <td><label> <input type="text" name="id" value="<%= no%>"/> </label></td> <td>&nbsp;</td> .... and so on

    Read the article

  • mysql_fetch_array() expects parameter 1 to be resource problem

    - by user225269
    I don't get it, I see no mistakes in this code but there is this error, please help: mysql_fetch_array() expects parameter 1 to be resource problem <?php $con = mysql_connect("localhost","root","nitoryolai123$%^"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("school", $con); $result = mysql_query("SELECT * FROM student WHERE IDNO=".$_GET['id']); ?> <?php while ($row = mysql_fetch_array($result)) { ?> <table class="a" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D3D3D3"> <tr> <form name="formcheck" method="get" action="updateact.php" onsubmit="return formCheck(this);"> <td> <table border="0" cellpadding="3" cellspacing="1" bgcolor=""> <tr> <td colspan="16" height="25" style="background:#5C915C; color:white; border:white 1px solid; text-align: left"><strong><font size="2">Update Students</td> <tr> <td width="30" height="35"><font size="2">*I D Number:</td> <td width="30"><input name="idnum" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $_GET['id']; ?>"></td> </tr> <tr> <td width="30" height="35"><font size="2">*Year:</td> <td width="30"><input name="yr" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $row["YEAR"]; ?>"></td> <?php } ?> I'm just trying to load the data in the forms but I don't know why that error appears. What could possibly be the mistake in here?

    Read the article

  • Refreshing <div> and load data from php

    - by forgatn
    I have on my page and there is a tag where is some and values filled from mySQL DB. I need some JavaScript I think. When I select one option, I want to display in this propriate DATAs which are in DB. without refreshing whole page. Can you tell me how to do it, if you know that please?:) <div id="country1" class="tabcontent"> <label>Choose protocol</label> <SELECT name="cisloprot"> <?php $con = mysql_connect("localhost", "root", "123456"); $sql = "SELECT kod FROM prot GROUP BY kod"; $rs = mysql_query($sql,$con); while ($r = mysql_fetch_array($rs)) { echo "<OPTION VALUE=".$r['kod'].">".$r['kod']."</OPTION>"; } ?> </SELECT> </div>

    Read the article

  • How to fetch a random record from SQLite database?

    - by Bruce
    I am working on PHP. I was working with MySQL before. Here is the code I used - $offset_result = mysqli_query($con, " SELECT FLOOR(RAND() * COUNT(*)) AS `offset` FROM students "); $offset_row = mysqli_fetch_object( $offset_result ); $offset = $offset_row->offset; $result = mysqli_query($con, " SELECT name FROM students LIMIT $offset, 1 " ); $row = mysqli_fetch_row($result); mysqli_free_result($result); What will be the corresponding set of statements for SQLite?

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >