Click here to Skip to main content
15,924,193 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Using MS Interop Word to Retrieve a document from a SQL table. Pin
Ramasubramaniam23-Aug-06 10:11
Ramasubramaniam23-Aug-06 10:11 
GeneralRe: Using MS Interop Word to Retrieve a document from a SQL table. Pin
spglover23-Aug-06 10:48
spglover23-Aug-06 10:48 
QuestionASP.NET retreiving from the database on a form depending on another form? Pin
Solly7423-Aug-06 8:09
Solly7423-Aug-06 8:09 
AnswerRe: ASP.NET retreiving from the database on a form depending on another form? Pin
Not Active23-Aug-06 8:13
mentorNot Active23-Aug-06 8:13 
GeneralRe: ASP.NET retreiving from the database on a form depending on another form? Pin
Solly7423-Aug-06 8:32
Solly7423-Aug-06 8:32 
GeneralRe: ASP.NET retreiving from the database on a form depending on another form? Pin
Not Active23-Aug-06 9:13
mentorNot Active23-Aug-06 9:13 
GeneralRe: ASP.NET retreiving from the database on a form depending on another form? Pin
Solly7423-Aug-06 9:20
Solly7423-Aug-06 9:20 
Questionlast insert id fails and returns null Pin
tim_gunning23-Aug-06 8:02
tim_gunning23-Aug-06 8:02 
hi
i have this infuriating problem thats driving me up the wall... I took over a project and wrote the frontend for a site however the admin (someone elses effort) keeps breaking, this code below always return 0 ie: i is always null.

<code>
private void Page_Load(object sender, System.EventArgs e)
{
foo.Text += this.createPage( "foo_test", 2, 3, 18131).ToString()+"::";
}
public int createPage(string name, int order, int page_resource_id, int customer_di_id)
{
string query;
query = "INSERT INTO foo (id, ord, name, page_resource_id) VALUES (?id, ?ord, ?name, ?page_resource_id); SELECT LAST_INSERT_ID();";

MySqlConnection con = new MySqlConnection( ConfigurationSettings.AppSettings["database_connstring"].ToString() );
con.Open();
MySqlCommand cmd = new MySqlCommand(query, con);

cmd.Parameters.Add(new MySqlParameter("?name", name));
cmd.Parameters.Add(new MySqlParameter("?ord", order));
cmd.Parameters.Add(new MySqlParameter("?page_resource_id", page_resource_id));
cmd.Parameters.Add(new MySqlParameter("?id", customer_di_id));

object i = null;
i = cmd.ExecuteScalar();
con.Close();

int result = 0;

if (i != null)
{
result = int.Parse(i.ToString());
}

return result;
}

</code>

i have similar code working fine elsewhere (the frontend) but this ALWAYS fails and the reason.... as soon as the id in foo goes above 65535. It works fine up to then, and then always returns 0.

i've stuck it in one page just test it, theres a whole load of other stuff going on but that all fine its just hereand I really dont get it at all. foo.Text is just a label on a blank page again for testing only

if im being incredibly thick please point it out, but ive been staring at this for hours now and cant work it out and cant find anything on google or anywhere.

ta

t
AnswerRe: last insert id fails and returns null Pin
Not Active23-Aug-06 8:09
mentorNot Active23-Aug-06 8:09 
GeneralRe: last insert id fails and returns null Pin
tim_gunning23-Aug-06 8:17
tim_gunning23-Aug-06 8:17 
GeneralRe: last insert id fails and returns null Pin
Not Active23-Aug-06 9:10
mentorNot Active23-Aug-06 9:10 
GeneralRe: last insert id fails and returns null Pin
tim_gunning23-Aug-06 11:20
tim_gunning23-Aug-06 11:20 
AnswerRe: last insert id fails and returns null Pin
Guffa23-Aug-06 8:35
Guffa23-Aug-06 8:35 
GeneralRe: last insert id fails and returns null Pin
tim_gunning23-Aug-06 9:38
tim_gunning23-Aug-06 9:38 
Questionget windows network login username Pin
playout23-Aug-06 7:42
playout23-Aug-06 7:42 
AnswerRe: get windows network login username Pin
ToddHileHoffer23-Aug-06 7:57
ToddHileHoffer23-Aug-06 7:57 
AnswerRe: get windows network login username Pin
Ramasubramaniam23-Aug-06 7:59
Ramasubramaniam23-Aug-06 7:59 
Questionremove item from arraylist Pin
playout23-Aug-06 7:37
playout23-Aug-06 7:37 
AnswerRe: remove item from arraylist Pin
ToddHileHoffer23-Aug-06 7:56
ToddHileHoffer23-Aug-06 7:56 
GeneralRe: remove item from arraylist Pin
playout23-Aug-06 8:08
playout23-Aug-06 8:08 
AnswerRe: remove item from arraylist Pin
Not Active23-Aug-06 8:25
mentorNot Active23-Aug-06 8:25 
QuestionUser details. Pin
NaNg1524123-Aug-06 7:13
NaNg1524123-Aug-06 7:13 
QuestionHistory List for a Form Field Pin
#realJSOP23-Aug-06 5:35
professional#realJSOP23-Aug-06 5:35 
AnswerRe: History List for a Form Field Pin
Rama Krishna Vavilala23-Aug-06 6:02
Rama Krishna Vavilala23-Aug-06 6:02 
GeneralRe: History List for a Form Field [modified] Pin
#realJSOP23-Aug-06 6:08
professional#realJSOP23-Aug-06 6:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.