Search Results

Search found 39491 results on 1580 pages for 'insert id'.

Page 8/1580 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to callback the new list id jQuery UI: sortable

    - by PARyGuy
    Hi, I'm trying to use the sortable widget for my site. I have a mini scheduling app that I'd like to display a list of appointments for the week sorted by days. For this example we'll use only two days ( 2 lists ). If I wanted to drag an appointment (list item) from day 2 over to day 1, is there a way I can callback the id of list 1 after I dragged an item to it? I can find the id of the parent list upon page load but I can't seem to be able to pull the new id after sort. Is this even possible? <script type="text/javascript"> $(function() { $("#day1, #day2").sortable({ connectWith: '.sortable' }).disableSelection(); }); </script>

    Read the article

  • Unique SMS sender id?

    - by Pascal
    Hello, I want to build an app that send SMS to people. However, I want my users to know that the SMS comes from the app and nothing else so they can't fake it. Is there a way to guarantee that the sender ID is unique to my app? It seems that sending a SMS by phone is with a unique SENDER ID for each phone number. But, from what I read, I don't think it is the case when sending a SMS through a web gateway. Is this correct? I am not an expert in mobile phone security. Of course, I am willing to pay the price for a unique sender id, if such thing is possible. Regards, Pascal

    Read the article

  • MYSQL Fast Insert dependent on flag from a seperate table

    - by Stuart P
    Hi all. For work I'm dealing with a large database (160 million + rows a year, 10 years of data) and have a quandary; A large percentage of the data we upload is null data and I'd like to stop it from being uploaded. The data in question is spatial in nature, so I have one table like so: idLocations (Auto-increment int, PK) X (float) Y (foat) Alwaysignore (Bool) Which is used as a reference in a second table like so: idLocations (Int, PK, "FK") idDates (Int, PK, "FK") DATA1 (float) DATA2 (float) ... DATA7 (float) So, Ideally I'd like to find a method where I can do something like: INSERT INTO tblData(idLocations, idDates, DATA1, ..., DATA7) VALUES (...), ..., (...) WHERE VALUES(idLocations) NOT LIKE (SELECT FROM tblLocation WHERE alwaysignore=TRUE ON DUPLICATE KEY UPDATE DATA1=VALUES(DATA1) So, for my large batch of input data (250 values in a block), ignore the inserts where the idLocations matches an idLocations values flagged with alwaysignore. Anyone have any suggestions? Cheers. -Stuart Other details: Running MySQL on a semi-dedicated machine, MyISAM engine for the tables.

    Read the article

  • mysqli insert problem

    - by Simon
    Hello i have this error: Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn't match number of bind variables in E:\wamp\www\classes\UserLogin.php on line 31 and i dont know what it is :/ here is my code function createUser($username, $password) { $mysql = connect(); if($stmt = $mysql->prepare('INSERT INTO users (username, password, alder, hood, fornavn, efternavn, city, ip, level, email) VALUES (?,?,?,?,?,?,?,?,?,?)')) { $stmt->bind_param($username,$password, $alder, $hood, $fornavn, $efternavn, $city, $ip, $level, $email); $stmt->execute(); $stmt->close(); } else { echo 'error: ' . $mysql->error; } then my user create the user they only need to type username and password, and later they can edit the profile and edit, email,alder,hood and like that :). Thanks for helping me

    Read the article

  • Insert xelements using LINQ Select?

    - by Simon Woods
    I have a source piece of xml into which I want to insert multiple elements which are created dependant upon certain values found in the original xml At present I have a sub which does this for me: <Extension()> Public Sub AddElements(ByVal xml As XElement, ByVal elementList As IEnumerable(Of XElement)) For Each e In elementList xml.Add(e) Next End Sub And this is getting invoked in a routine as follows: Dim myElement = New XElement("NewElements") myElement.AddElements( xml.Descendants("TheElements"). Where(Function(e) e.Attribute("FilterElement") IsNot Nothing). Select(Function(e) New XElement("NewElement", New XAttribute("Text", e.Attribute("FilterElement").Value)))) Is it possible to re-write this using Linq syntax so I don't need to call out to the Sub AddElements but could do it all in-line Many Thx Simon

    Read the article

  • Adding a Line Break in mySQL INSERT INTO text

    - by james
    Hi Could someone tell me how to add a new line in a text that i enter in a mySql table. I tried using the '\n in the line i entered with INSERT INTO statement but '\n is shown as it is. Actually i have created a table in Ms Access with some data. Ms Access adds new line with '\n. I am converting Ms Access table data into mySql . But when i convert, the '\n is ignored and all the text is shown in one single line when i display it from mySql table on a php form. Can anyone tell me how mySQL can add a new line in a text ? Awaiting response Thanks !!

    Read the article

  • Insert value in SQL database

    - by littleBrain
    In SQL Server 2005, I'm trying to figure out How to fill up the following fields? Any kind of help will be highly appreciated.. INSERT INTO [Fisharoo].[dbo].[Accounts] ([FirstName] ,[LastName] ,[Email] ,[EmailVerified] ,[Zip] ,[Username] ,[Password] ,[BirthDate] ,[CreateDate] ,[LastUpdateDate] ,[TermID] ,[AgreedToTermsDate]) VALUES (<FirstName, varchar(30),> ,<LastName, varchar(30),> ,<Email, varchar(150),> ,<EmailVerified, bit,> ,<Zip, varchar(15),> ,<Username, varchar(30),> ,<Password, varchar(50),> ,<BirthDate, smalldatetime,> ,<CreateDate, smalldatetime,> ,<LastUpdateDate, smalldatetime,> ,<TermID, int,> ,<AgreedToTermsDate, smalldatetime,>)

    Read the article

  • Question About id and Delegate Usage in Obj-C

    - by Stunner
    Ey guys, I am wondering what the following line of code is doing: @property (assign, nonatomic) id <CoursePlannerDelegate> delegate; Namely I am wondering about this portion of the line: id <CoursePlannerDelegate> delegate; It also shows up in other places: @interface CategoryAddViewController : UIViewController { UITextField *nameField, *weightField; double maxWeight; //The maximum weight that can be allocated to this Category (max value of 100) id <CategoryAddDelegate> delegate; //A Course Planner TVC } Any help appreciated, thanks in advance!

    Read the article

  • PHP MySQL Insert Help

    - by user364333
    Hey I am trying to make a page that inserts some strings into a MySQL table but it just dosn't seem to be working for me. Here is the code I am using at the moment. <?php mysql_connect($address, $username, $password); @mysql_select_db($database) or die("Unable to select database"); $query = "insert INTO user (movieid, moviename)('" . $id . "','" . $name . "') or die(mysql_error())"; mysql_query($query); mysql_close(); ?> Where am i going wrong?

    Read the article

  • SQL Server insert with XML parameter - empty string not converting to null for numeric

    - by Mayo
    I have a stored procedure that takes an XML parameter and inserts the "Entity" nodes as records into a table. This works fine unless one of the numeric fields has a value of empty string in the XML. Then it throws an "error converting data type nvarchar to numeric" error. Is there a way for me to tell SQL to convert empty string to null for those numeric fields in the code below? -- @importData XML <- stored procedure param DECLARE @l_index INT EXECUTE sp_xml_preparedocument @l_index OUTPUT, @importData INSERT INTO dbo.myTable ( [field1] ,[field2] ,[field3] ) SELECT [field1] ,[field2] ,[field3] FROM OPENXML(@l_index, 'Entities/Entity', 1) WITH ( field1 int 'field1' ,field2 varchar(40) 'field2' ,field3 decimal(15, 2) 'field3' ) EXECUTE sp_xml_removedocument @l_index EDIT: And if it helps, sample XML. Error is thrown unless I comment out field3 in the code above or provide a value in field3 below. <?xml version="1.0" encoding="utf-16"?> <Entities> <Entity> <field1>2435</field1> <field2>843257-3242</field2> <field3 /> </Entity> </Entities>

    Read the article

  • insert data to table based on another table C#

    - by user1017315
    I wrote a code which takes some values from one table and inserts the other table in these values.(not just these values, but also these values(this values=values from the based on table)) and I get this error: System.Data.OleDb.OleDbException (0x80040E10): value wan't given for one or more of the required parameters.` here's the code. I don't know what i've missed. string selectedItem = comboBox1.SelectedItem.ToString(); Codons cdn = new Codons(selectedItem); string codon1; int index; if (this.i != this.counter) { //take from the DataBase the matching codonsCodon1 to codonsFullName codon1 = cdn.GetCodon1(); //take the serialnumber of the last protein string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=C:\\Projects_2012\\Project_Noam\\Access\\myProject.accdb"; OleDbConnection conn = new OleDbConnection(connectionString); conn.Open(); string last= "SELECT proInfoSerialNum FROM tblProInfo WHERE proInfoScienceName = "+this.name ; OleDbCommand getSerial = new OleDbCommand(last, conn); OleDbDataReader dr = getSerial.ExecuteReader(); dr.Read(); index = dr.GetInt32(0); //add the amino acid to tblOrderAA using (OleDbConnection connection = new OleDbConnection(connectionString)) { string insertCommand = "INSERT INTO tblOrderAA(orderAASerialPro, orderAACodon1) " + " values (?, ?)"; using (OleDbCommand command = new OleDbCommand(insertCommand, connection)) { connection.Open(); command.Parameters.AddWithValue("orderAASerialPro", index); command.Parameters.AddWithValue("orderAACodon1", codon1); command.ExecuteNonQuery(); } } } EDIT:I put a messagebox after that line: index = dr.GetInt32(0); to see where is the problem, and i get the error before that.i don't see the messagebox

    Read the article

  • entity framework insert bug

    - by tmfkmoney
    I found a previous question which seemed related but there's no resolution and it's 5 months old so I've opened my own version. http://stackoverflow.com/questions/1545583/entity-framework-inserting-new-entity-via-objectcontext-does-not-use-existing-e When I insert records into my database with the following it works fine for a while and then eventually it starts inserting null values in the referenced field. This typically happens after I do an update on my model from the database although not always after I do an update. I'm using a MySQL database for this. I have debugged the code and the values are being set properly before the save event. They're just not getting inserted properly. I can always fix this issue by re-creating the model without touching any of my code. I have to recreate the entire model, though. I can't just dump the relevant tables and re-add them. This makes me think it doesn't have anything to do with my code but something with the entity framework. Does anyone else have this problem and/or solved it? using (var db = new MyModel()) { var stocks = from record in query let ticker = record.Ticker select new { company = db.Companies.FirstOrDefault(c => c.ticker == ticker), price = Convert.ToDecimal(record.Price), date_stamp = Convert.ToDateTime(record.DateTime) }; foreach (var stock in stocks) { if (stock.company != null) { var price = new StockPrice { Company = stock.company, price = stock.price, date_stamp = stock.date_stamp }; db.AddToStockPrices(price); } } db.SaveChanges(); }

    Read the article

  • Oracle Insert via Select from multiple tables where one table may not have a row

    - by Mikezx6r
    I have a number of code value tables that contain a code and a description with a Long id. I now want to create an entry for an Account Type that references a number of codes, so I have something like this: insert into account_type_standard (account_type_Standard_id, tax_status_id, recipient_id) ( select account_type_standard_seq.nextval, ts.tax_status_id, r.recipient_id from tax_status ts, recipient r where ts.tax_status_code = ? and r.recipient_code = ?) This retrieves the appropriate values from the tax_status and recipient tables if a match is found for their respective codes. Unfortunately, recipient_code is nullable, and therefore the ? substitution value could be null. Of course, the implicit join doesn't return a row, so a row doesn't get inserted into my table. I've tried using NVL on the ? and on the r.recipient_id. I've tried to force an outer join on the r.recipient_code = ? by adding (+), but it's not an explicit join, so Oracle still didn't add another row. Anyone know of a way of doing this? I can obviously modify the statement so that I do the lookup of the recipient_id externally, and have a ? instead of r.recipient_id, and don't select from the recipient table at all, but I'd prefer to do all this in 1 SQL statement.

    Read the article

  • How to insert form data into MySQL database table

    - by Richard
    So I have this registration script: The HTML: <form action="register.php" method="POST"> <label>Username:</label> <input type="text" name="username" /><br /> <label>Password:</label> <input type="text" name="password" /><br /> <label>Gender:</label> <select name="gender"> <optgroup label="genderset"> <option value="Male">Male</option> <option value="Female">Female</option> <option value="Hermaphrodite">Hermaphrodite</option> <option value="Not Sure!!!">Not Sure!!!</option> </optgroup> </select><br /> <input type="submit" value="Register" /> </form> The PHP/SQL: <?php $username = $_POST['username']; $password = $_POST['password']; $gender = $_POST['gender']; mysql_query("INSERT INTO registration_info (username, password, gender) VALUES ('$username', '$password', '$gender') ") ?> The problem is, the username and password gets inserted into the "registration_info" table just fine. But the Gender input from the select drop down menu doesn't. Can some one tell me how to fix this, thanks.

    Read the article

  • C++ STL question related to insert iterators and sets

    - by rshepherd
    #include #include #include #include using namespace std; class MyContainer { public: string value; MyContainer& operator=(const string& s) { this->value = s; return *this; } }; int main() { list<string> strings; strings.push_back("0"); strings.push_back("1"); strings.push_back("2"); set<MyContainer> containers; copy(strings.begin(), strings.end(), inserter(containers, containers.end())); } The preceeding code does not compile. In typical STL style the error output is verbose and difficult to understand. The key part seems to be this... /usr/include/c++/4.4/bits/stl_algobase.h:313: error: no match for ‘operator=’ in ‘__result.std::insert_iterator::operator* [with _Container = std::set, std::allocator ]() = __first.std::_List_iterator::operator* [with _Tp = std::basic_string, std::allocator ]()’ ...which I interpet to mean that the assignment operator needed is not defined. I took a look at the source code for insert_iterator and noted that it has overloaded the assignment operator. The copy algorithm must uses the insert iterators overloaded assignment operator to do its work(?). I guess that because my input iterator is on a container of strings and my output iterator is on a container of MyContainers that the overloaded insert_iterator assignment operator can no longer work. This is my best guess, but I am probably wrong. So, why exactly does this not work and how can I accomplish what I am trying to do?

    Read the article

  • Need help INSERT record(s) MySQL DB

    - by JM4
    I have an online form which collects member(s) information and stores it into a very long MySQL database. We allow up to 16 members to enroll at a single time and originally structured the DB to allow such. For example: If 1 Member enrolls, his personal information (first name, last name, address, phone, email) are stored on a single row. If 15 Members enroll (all at once), their personal information are stored in the same single row. The row has information housing columns for all 'possible' inputs. I am trying to consolidate this code and having every nth member that enrolls put onto a new record within the database. I have seen sugestions before for inserting multiple records as such: INSERT INTO tablename VALUES (('$f1name', '$f1address', '$f1phone'), ('$f2name', '$f2address', '$f2phone')... The issue with this is two fold: I do not know how many records are being enrolled from person to person so the only way to make the statement above is to use a loop The information collected from the forms is NOT a single array so I can't loop through one array and have it parse out. My information is collected as individual input fields like such: Member1FirstName, Member1LastName, Member1Phone, Member2Firstname, Member2LastName, Member2Phone... and so on Is it possible to store information in separate rows WITHOUT using a loop (and therefore having to go back and completely restructure my form field names and such (which can't happen due to the way the validation rules are built.)

    Read the article

  • Manage and Monitor Identity Ranges in SQL Server Transactional Replication

    - by Yaniv Etrogi
    Problem When using transactional replication to replicate data in a one way topology from a publisher to a read-only subscriber(s) there is no need to manage identity ranges. However, when using  transactional replication to replicate data in a two way replication topology - between two or more servers there is a need to manage identity ranges in order to prevent a situation where an INSERT commands fails on a PRIMARY KEY violation error  due to the replicated row being inserted having a value for the identity column which already exists at the destination database. Solution There are two ways to address this situation: Assign a range of identity values per each server. Work with parallel identity values. The first method requires some maintenance while the second method does not and so the scripts provided with this article are very useful for anyone using the first method. I will explore this in more detail later in the article. In the first solution set server1 to work in the range of 1 to 1,000,000,000 and server2 to work in the range of 1,000,000,001 to 2,000,000,000.  The ranges are set and defined using the DBCC CHECKIDENT command and when the ranges in this example are well maintained you meet the goal of preventing the INSERT commands to fall due to a PRIMARY KEY violation. The first insert at server1 will get the identity value of 1, the second insert will get the value of 2 and so on while on server2 the first insert will get the identity value of 1000000001, the second insert 1000000002 and so on thus avoiding a conflict. Be aware that when a row is inserted the identity value (seed) is generated as part of the insert command at each server and the inserted row is replicated. The replicated row includes the identity column’s value so the data remains consistent across all servers but you will be able to tell on what server the original insert took place due the range that  the identity value belongs to. In the second solution you do not manage ranges but enforce a situation in which identity values can never get overlapped by setting the first identity value (seed) and the increment property one time only during the CREATE TABLE command of each table. So a table on server1 looks like this: CREATE TABLE T1 (  c1 int NOT NULL IDENTITY(1, 5) PRIMARY KEY CLUSTERED ,c2 int NOT NULL ); And a table on server2 looks like this: CREATE TABLE T1(  c1 int NOT NULL IDENTITY(2, 5) PRIMARY KEY CLUSTERED ,c2 int NOT NULL ); When these two tables are inserted the results of the identity values look like this: Server1:  1, 6, 11, 16, 21, 26… Server2:  2, 7, 12, 17, 22, 27… This assures no identity values conflicts while leaving a room for 3 additional servers to participate in this same environment. You can go up to 9 servers using this method by setting an increment value of 9 instead of 5 as I used in this example. Continues…

    Read the article

  • When do you say "near ID" / "far ID" when using RTMFP in ActionScript 3?

    - by Panzercrisis
    I've been using RTMFP streaming for around a year in ActionScript 3, and I pretty much know the difference between a near ID and far ID. The near ID is your peer ID, and the far ID is the other guy's peer ID. The problem I'm having is that, to my knowledge, choosing whether to use one term or the other in a given sentence is a little like choosing whether to say "go" or "come". In English, "go" and "come" have opposite meanings, but ironically, they can still be used almost interchangeably. It's because whether you're going or coming is so heavily dependent on perspective, as opposed to anything concrete. Is the choice of words between "near ID" and "far ID" just as ambiguous, or is there some sort of method to the madness? Thanks!

    Read the article

  • Reliable way of generating unique hardware ID

    - by mr.b
    Question: what's the best way to accomplish following. I have to come up with unique ID for each networked client, such that: it (ID) should persist once client software is installed on target computer, and should continue to persist if software is re-installed on same computer and same OS installment, it should not change if hardware configuration is modified in most ways (except changing the motherboard) When hard drive with client software installed is cloned to another computer with identical hardware configuration (or, as similar as possible), client software should be aware of that change. A little bit of explanation and some back-story: This question is basically age old question that also touches topic of software copy-protection, as some of mechanisms used in that area are mentioned here. I should be clear at this point that I'm not looking for a copy-protection scheme. Please, read on. :) I'm working on a client-server software that is supposed to work in local network. One of problems I have to solve is to identify each unique client in network (not so much of a problem), so that I can apply certain attributes to every specific client, retain and enforce those attributes during deployment lifetime of a specific client. While I was looking for a solution, I was aware of following: Windows activation system uses some kind of heavy fingerprinting mechanism, that is extremely sensitive to hardware modifications, Disk imaging software copies along all Volume IDs (tied to each partition when formatted), and custom, uniquely generated IDs during installation process, during first run, or in any other way, that is strictly software in its nature, and stored in registry or on hard drive, so it's very easy to confuse two Obvious choice for this kind of problem would be to find out BIOS identifiers (not 100% sure if this is unique through identical motherboard models, though), as that's the only thing I can rely on, that isn't duplicated, transferred by cloning, and that can't be changed (at least not by using some user-space program). Everything else fails as either being not reliable (MAC cloning, anyone?), or too demanding (in terms that it's too sensitive to configuration changes). Am I missing something obvious here? Sub-question that I'd like to ask is, am I doing it correctly, architecture-wise? Perhaps there is a better tool for task that I have to accomplish... Another approach I had in mind is something similar to handshake mechanism, where server maintains internal lookup table of connected client IDs (which can be even completely software-based and non-unique at any given moment), and tells client to come up with different ID during handshake, if duplicate ID is provided upon connection. That approach, unfortunately, doesn't play nicely with one of requirements to tie attributes to specific client during lifetime.

    Read the article

  • How do I INSERT INTO from one mysql table into another table and set the value of one column?

    - by Laxmidi
    Hi, I need to insert data from table1 into table2. However, I would like to set the myYear column in table2 to 2010. But, there isn't a myYear Column in table1. So, my basic insert looks like: INSERT INTO `table2` ( place, event ) SELECT place, event FROM table1 Roughly, I'd like to do something like the following: INSERT INTO `table2` ( place, event, SET myYear='2010' ) ... Is there a way to set the column value in the insert statement? THANK YOU! -Laxmidi

    Read the article

  • eclipse error with android: id cannot be resolved or is not a field

    - by Jaynathan Leung
    Hi, I just started playing around with android development, and already with just an attempt at making a button, I have encountered a problem. The error I'm given in the following code is right on "R.id.button1". It says id cannot be resolved or is not a field. Do I need to manually reference every single object I make in the layout xml file? I found that this did work, but it does seem to be a bit much for every button I want to make... package com.example.helloandroid; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ private Button button1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); button1 = (Button)findViewById(R.id.button1); button1.setOnClickListener(new OnClickListener() { public void onClick(View v) { finish(); } }); } }

    Read the article

  • Can't insert a record in a oracle database using C#

    - by Gya
    try { int val4 = Convert.ToInt32(tbGrupa.Text); string MyConString = "Data Source=**;User ID=******;Password=*****"; OracleConnection conexiune = new OracleConnection(MyConString); OracleCommand comanda = new OracleCommand(); comanda.Connection = conexiune; conexiune.Open(); comanda.Transaction = conexiune.BeginTransaction(); int id_stud = Convert.ToInt16(tbCodStud.Text); string nume = tbNume.Text; string prenume = tbPrenume.Text; string initiala_tatalui = tbInitiala.Text; string email = tbEmail.Text; string facultate = tbFac.Text; int grupa = Convert.ToInt16(tbGrupa.Text); string serie = tbSeria.Text; string forma_de_inv = tbFormaInvatamant.Text; DateTime data_acceptare_coordonare = dateTimePicker1.Value; DateTime data_sustinere_licenta = dateTimePicker2.Value; string sustinere = tbSustinereLicenta.Text; string parola_acces = tbParola.Text; try { comanda.Parameters.AddWithValue("id_stud", id_stud); comanda.Parameters.AddWithValue("nume", nume); comanda.Parameters.AddWithValue("prenume", prenume); comanda.Parameters.AddWithValue("initiala_tatalui", initiala_tatalui); comanda.Parameters.AddWithValue("facultate", facultate); comanda.Parameters.AddWithValue("email", email); comanda.Parameters.AddWithValue("seria", serie); comanda.Parameters.AddWithValue("grupa", grupa); comanda.Parameters.AddWithValue("forma_de_inv", forma_de_inv); comanda.Parameters.AddWithValue("data_acceptare_coordonare", data_acceptare_coordonare); comanda.Parameters.AddWithValue("data_sustinere_licenta", data_sustinere_licenta); comanda.Parameters.AddWithValue("sustinere_licenta", sustinere); comanda.Parameters.AddWithValue("parola_acces", parola_acces); comanda.Transaction.Commit(); MessageBox.Show("Studentul " + tbNume.Text + " " + tbPrenume.Text + " a fost adaugat în baza de date!"); } catch (Exception er) { comanda.Transaction.Rollback(); MessageBox.Show("ER1.1:" + er.Message); MessageBox.Show("ER1.2:" + er.StackTrace); } finally { conexiune.Close(); } } catch (Exception ex) { MessageBox.Show("ER2.1:"+ex.Message); MessageBox.Show("ER2.2:"+ex.StackTrace); }

    Read the article

  • can't insert arecord in a oracle database using C#

    - by Gya
    try { int val4 = Convert.ToInt32(tbGrupa.Text); string MyConString = "Data Source=**;User ID=******;Password=*****"; OracleConnection conexiune = new OracleConnection(MyConString); OracleCommand comanda = new OracleCommand(); comanda.Connection = conexiune; conexiune.Open(); comanda.Transaction = conexiune.BeginTransaction(); int id_stud = Convert.ToInt16(tbCodStud.Text); string nume = tbNume.Text; string prenume = tbPrenume.Text; string initiala_tatalui = tbInitiala.Text; string email = tbEmail.Text; string facultate = tbFac.Text; int grupa = Convert.ToInt16(tbGrupa.Text); string serie = tbSeria.Text; string forma_de_inv = tbFormaInvatamant.Text; DateTime data_acceptare_coordonare = dateTimePicker1.Value; DateTime data_sustinere_licenta = dateTimePicker2.Value; string sustinere = tbSustinereLicenta.Text; string parola_acces = tbParola.Text; try { comanda.Parameters.AddWithValue("id_stud", id_stud); comanda.Parameters.AddWithValue("nume", nume); comanda.Parameters.AddWithValue("prenume", prenume); comanda.Parameters.AddWithValue("initiala_tatalui", initiala_tatalui); comanda.Parameters.AddWithValue("facultate", facultate); comanda.Parameters.AddWithValue("email", email); comanda.Parameters.AddWithValue("seria", serie); comanda.Parameters.AddWithValue("grupa", grupa); comanda.Parameters.AddWithValue("forma_de_inv", forma_de_inv); comanda.Parameters.AddWithValue("data_acceptare_coordonare", data_acceptare_coordonare); comanda.Parameters.AddWithValue("data_sustinere_licenta", data_sustinere_licenta); comanda.Parameters.AddWithValue("sustinere_licenta", sustinere); comanda.Parameters.AddWithValue("parola_acces", parola_acces); comanda.Transaction.Commit(); MessageBox.Show("Studentul " + tbNume.Text + " " + tbPrenume.Text + " a fost adaugat în baza de date!"); } catch (Exception er) { comanda.Transaction.Rollback(); MessageBox.Show("ER1.1:" + er.Message); MessageBox.Show("ER1.2:" + er.StackTrace); } finally { conexiune.Close(); } } catch (Exception ex) { MessageBox.Show("ER2.1:"+ex.Message); MessageBox.Show("ER2.2:"+ex.StackTrace); } }

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >